然后键入以下命令:pyinstaller filename.py完成后,我们将在当前文件夹中看到两个文件夹 “Build” 和 “Dist” 。在 “Dist” 文件夹中有一个与脚本文件名称相同的文件夹,文件夹内就能找到我们需要的 “1.exe” 可执行文件,双击运行。使用 auto-py-to-exe其实,auto-py-to-exe 是基于 GUI 图形用户界面的...
ENFailed to execute script 'main' due to unhandled exception: No file 'Assets/icon.png' found ...
#将所在文件夹的1.py转换为exe文件;#需要安装pyinstaller库#pip install pyinstallerimportosimportsubprocessdefconvert_to_exe(script_name):# 获取当前脚本所在的目录current_directory=os.path.dirname(os.path.abspath(__file__))# 构建目标文件的完整路径script_path=os.path.join(current_directory,script_name)...
在使用 auto-py-to-exe 打包 python 程序的时候,有许多配置选项需要我们去指定,能正确知道这些选项的作用是十分重要的。下面我将介绍其中一些重要的选项。 (1) Script Location Script Location 主要是指定我们要打包的 python 文件 (2) Onefile Onefile 下有两个选项,分别是:One Directory 和 One File 如果选择...
–icon=<FILE.ICO>将file.ico添加为可执行文件的资源(只对Windows系统有效),改变程序的图标 pyinstaller-i ico路径 xxxxx.py –icon=<FILE.EXE,N>将file.exe的第n个图标添加为可执行文件的资源(只对Windows系统有效)-vFILE,–version=FILE将verfile作为可执行文件的版本资源(只对Windows系统有效)-nNAME,–name...
optional name to assign to the project (from which the spec file name is generated). If omitted, the basename of the (first) script is used. 11、成功后生成一个和py脚本同名的目录(deploy_web),在dict目录下就生成一个.exe 程序。 12、执行完.exe程序后生成一个txt文件,里面就是想要的信息、...
Adding setuptools40.8.0to easy-install.pthfile Installing easy_install-script.py script to C:\Program Files\Python3\Scripts Installing easy_install.exe script to C:\Program Files\Python3\Scripts Installing easy_install-3.6-script.py script to C:\Program Files\Python3\Scripts ...
options = {"py2exe": { "bundle_files": 1 } } setup(options = options, zipfile=None, console = [{"script":'httest.py', 'icon_resources':[(1,'test.ico')]}]) --- 2.生成一个文件 from distutils.core import setup import py2exe import sys includes = ["encodings", "encodings.*"...
# @File : game2048.py # Begin to show your code! import curses # 绘制在下的用户界面和漂亮的图形 from random import randrange, choice from collections import defaultdict letter_codes = [ord(ch) for ch in 'WASDRQwasdrq'] # 上左下右,ord函数是把字符转换成对应的数字 ...
安装autopytoexe:确保Python环境版本大于等于2.7。在命令行中输入pip install autopytoexe,完成安装。使用autopytoexe打包程序:启动工具:在命令行中输入autopytoexe启动图形化界面。配置选项:Script Location:指定要打包的Python文件路径。Onefile:选择“One File”选项,使打包后的程序看起来更简洁。另...