【发布时间】:2022-08-17 00:02:25
【问题描述】:
我有我的convert.py 文件,可以将myFile.py 转换为myFile.exe,并且可以正常工作。但是当我将convert.py 转换为convert.exe 时,它不会再转换myFile.py。
所有这些文件都在一个文件夹中:
convert.py:
import PyInstaller.__main__
PyInstaller.__main__.run([os.path.abspath(\"myFile.py\"), \'--noconfirm\', \'--onefile\', \'--console\', f\'--icon={os.path.abspath(\"icon.ico\")}\', \"--name\", \"myFile\"])
myFile.py:
print(\"Hello World!\")
while True:
continue
运行convert.exe 时,应创建2 个文件夹:build 和dist,myFile.exe 应在dist 内创建,但here\'s a video of what\'s happening 和here\'s a video of what should be happening。
-
在已经打开的命令提示符下运行
convert.exe并发布输出。
标签: python pyinstaller exe executable