简体   繁体   中英

Problem with correctly running .exe file from python file

I want to run.exe file from python file, but there is problem with reading from txt file. Exe doesn't throw any errors, but it looks like it doesn't even open any.txt. Additionally, .exe works well, when I enter the folder and run it manually. How I run.exe in python:

subprocess.check_call(['D:\Projects\PythonProjects\PrivateGithub\MinMax\EXE\Run.exe'])

Should I do something 'special' to be able to read from files?

Try this code to run the exe:

import os
os.startfile('D:\Projects\PythonProjects\PrivateGithub\MinMax\EXE\Run.exe')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM