目录
一、安装
二、使用Pyinstaller生成exe
三、显示效果
一、安装
1、安装pywin32
- 下载安装文件:下载适合python版本的pywin32
- pip命令安装:pip install pywin32
2、安装Pyinstaller
- 官网下载:Pyinstaller官网
- pip命令安装:pip install PyInstaller
3、安装pywin32-ctypes
- pip命令安装:pip install pywin32-ctypes
- 官网下载:pywin32-ctypes官网
二、使用Pyinstaller生成exe
1、使用下载安装的方式安装的Pyinstaller打包方式(推荐)
管理员打开cmd,并且复制.py文件到Pyinstaller文件夹中(与pyinstaller.py同一层文件夹下),之后把路径切换到当前路径打开命令提示行,输入以下内容(xxx.py是文件名):
- python pyinstaller.py -F xxx.py
2、pip方式安装的Pyinstaller打包方式(不推荐)
管理员打开cmd,把路径切换到文件所在路径,输入以下内容:
- pyinstaller -F xxx.py
3、pyinstaller输入参数
-
-F 生成单个可执行文件
-
-w 去掉控制台窗口
-
-p 自定义需要加载的类路径
-
-i 可执行文件的图标