zoukankan      html  css  js  c++  java
  • python 使用PyInstaller将程序打包

      PyInstaller可以用来打包python应用程序,打包完的程序就可以在没有安装Python解释器的机器上运行了。类似于C#窗体程序使用Setup Factory 9 Trial进行打包。

    安装:PyInstaller,打开cmd命令行执行 pip install pyinstaller

    pip install pyinstaller

    当出现Successfully表示安装成功

    打包:接下来找到将要打包的程序,例如我的放在 F:PythonPython36-32Project,然后执行 pyinstaller -F +文件名即可,这里我的文件名为SevenDigitsDrawV2.py

    pyinstaller -F SevenDigitsDrawV2.py

    然后可以在目录下看到多出来三个文件夹,即:__pycache__,build,dist,其中__pycache__,build无用可删除,生成好的exe文件在dist下。

    打开便可执行应用程序。

    PyInstaller 库常用参数:

    参数 描述
    -h 查看帮助
    --clean 清理打包过程中的临时文件
    -D,--onedir 默认值。生成dist文件夹
    -F,--onefile 在dist文件夹中只生成独立的打包文件
    -i <图标文件名.ico> 指定打包程序使用的图标(icon)文件
  • 相关阅读:
    需求分析的方法与实践
    系统架构分析与设计方法论
    装修-3
    装修-2
    装修-1
    daikuan
    JAVA容器全面总结
    超图8C iserver启动成功,访问不了网站localhost:8090/iserver/manager,显示404
    Arcgis中给字段添加属性域
    arcgis for server搭建集群环境
  • 原文地址:https://www.cnblogs.com/swjian/p/9096906.html
Copyright © 2011-2022 走看看