Skip to content Skip to sidebar Skip to footer

How To Run/execute Exe File In Python?

I still new with python. I try to run an exe file by using python. Can i know what should i use and import?

Solution 1:

import subprocess

subprocess.call(['C:\\Temp\\a b c\\Notepad.exe', 'C:\\test.txt'])

import os

os.system(r'"C:/Documents and Settings/flow_model/flow.exe"')

Solution 2:

import osos.system("path_to_exe")

Try using this it will work for sure.

Solution 3:

Use subprocess module.

import subprocess
subprocess.Popen([r"path\filename.exe"]

Post a Comment for "How To Run/execute Exe File In Python?"