[英]How to make a call to an executable from another executable/Python script on Mac?
我在 windows 上用os.system("filename.exe")
做同样的事情
但是在 mac 上,pyinstaller 正在创建 unix 可执行文件并且没有扩展名。
我试过os.system("filename")
没有用。
我也试过os.system("./filename")
它在 python 脚本上工作,但是当我制作可执行文件时它不起作用。
如果可执行文件是 python 只需导入文件,它将运行主块假设这是a.py
print('hello')
在你的python代码中做
import a
输出将是
hello
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.