> 文章列表 > 使用tkinter和pyinstaller可视化python界面并打包python程序

使用tkinter和pyinstaller可视化python界面并打包python程序

使用tkinter和pyinstaller可视化python界面并打包python程序

  1. 编写带有tkinter的python程序

  2. cmd窗口新建环境
    conda create -n 【work_project】 python==3.8
    conda activate 【work_project】

  3. 新建一个工作目录【work_project】_dir,使用如下命令:
    cd C:\\Users\\15135\\Desktop\\【work_project】_dir

  4. 安装一些环境
    pip install pyinstaller(必选)
    pip install Pillow

  5. 找到一个图片,后缀改为.ico。
    icon.ico,放到工作目录【work_project】_dir中。

  6. 打包程序
    pyinstaller -F -w .\\03.py -i .\\icon.ico

  7. 运行dist目录下的exe程序。