简体   繁体   中英

How to make a call to an executable from another executable/Python script on Mac?

I was doing the same on windows with os.system("filename.exe")

But on mac, pyinstaller is creating unix executable and have no extension to it.

I've tried os.system("filename") which didn't work.

I've also tried os.system("./filename") which worked on python script but when I make executable file it is not working.

if the executable is python just import the file and it will run the main block assume this is a.py

print('hello')

and in your python code do

import a

the output will be

hello

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