954,525 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

running an exe file from python script to process another file

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

[email]krampuswillgetyou@gmail.com[/email]

o0b3600
Newbie Poster
2 posts since Mar 2010
Reputation Points: 10
Solved Threads: 0
 

Take a look at the os module.

Something like:

import os

os.system("NameOfExe.exe")


This will start the .exe

Tech B
Posting Whiz in Training
268 posts since May 2009
Reputation Points: 59
Solved Threads: 33
 
Gribouillis
Posting Maven
Moderator
2,786 posts since Jul 2008
Reputation Points: 1,044
Solved Threads: 691
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: