How to run/execute exe file in python?

2020-05-10 06:59发布

I still new with python. I try to run an

exe

file by using python. Can i know what should i use and import?

3条回答
一纸荒年 Trace。
2楼-- · 2020-05-10 07:19
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"')
查看更多
三岁会撩人
3楼-- · 2020-05-10 07:24

Use subprocess module.

import subprocess
subprocess.Popen([r"path\filename.exe"]
查看更多
家丑人穷心不美
4楼-- · 2020-05-10 07:34
import os
os.system("path_to_exe")

Try using this it will work for sure.

查看更多
登录 后发表回答