Hello,

I found this website while I was trying to search a solution/ recipe for a problem I am trying to tackle... I am very new to python :(

How can I run an executable file from a python script?

for example:

All the files (python script - filename.py-, executable file -filename.exe-, and the file that needs to be processed by the executable file -filename.txt-) are in the same directory - new_folder-.

What do I need to write or include to my script (filename.py) so that it would start filemane.exe would process filename.txt and produce an output file / results?

any help is greatly appreciated!

you can directly email me at

krampuswillgetyou@gmail.com

Take a look at the os module.

Something like:

import os

os.system("NameOfExe.exe")

This will start the .exe

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.