操作步骤: 先安装pyinstaller,在终端中输入pip install pyinstaller即可。 打包程序: pyinstaller --console --onefile 7.py 在dist文件夹里面即可找到可执行文件。