iis服务器助手广告广告
返回顶部
首页 > 资讯 > 后端开发 > Python >python 将python程序编译成可
  • 691
分享到

python 将python程序编译成可

编译成程序python 2023-01-31 06:01:20 691人浏览 安东尼

Python 官方文档:入门教程 => 点击学习

摘要

一、使用pyinstaller 完成对python程序到可执行文件转换. 官网: Http://www.pyinstaller.org/ 下载与操作系统相匹配的版本. 目前pyinstaller 只支持2.3 - 2.7。 不支持Pytho

一、使用pyinstaller 完成对python程序到可执行文件转换.

官网: Http://www.pyinstaller.org/ 下载与操作系统相匹配的版本. 目前pyinstaller 只支持2.3 - 2.7。 不支持Python.3

二、将下载的pyinstaller-2.0.zip文件解压,解压后可直接使用。

    pyinstaller不依赖python,因此不需要放入到 site-packages此目录.

三、pyinstaller 使用及参数

  1. C:\pyinstaller-2.0>python pyinstaller.py -F -w --icon=E:\p_w_picpaths\96.ico MonitorWin32Process.py 
  2. 38 INFO: wrote C:\pyinstaller-2.0\MonitorWin32Process\MonitorWin32Process.spec 
  3. 60 INFO: Testing for ability to set icons, version resources... 
  4. 75 INFO: ... resource update available 
  5. 78 INFO: UPX is not available. 
  6. 1154 INFO: checking Analysis 
  7. 1156 INFO: building Analysis because out00-Analysis.toc non existent 
  8. 1157 INFO: running Analysis out00-Analysis.toc 
  9. 1159 INFO: Adding Microsoft.VC90.CRT to dependent assemblies of final executable 
  10.  
  11. 1253 INFO: Searching for assembly x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21 
  12. 022.8_none ... 
  13. 1255 INFO: Found manifest C:\windows\WinSxS\Manifests\x86_microsoft.vc90.crt_1fc 
  14. 8b3b9a1e18e3b_9.0.21022.8_none_bcb86ed6ac711f91.manifest 
  15. 1258 INFO: Searching for file msvcr90.dll 
  16. 1259 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_ 
  17. 9.0.21022.8_none_bcb86ed6ac711f91\msvcr90.dll 
  18. 1259 INFO: Searching for file msvcp90.dll 
  19. 1261 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_ 
  20. 9.0.21022.8_none_bcb86ed6ac711f91\msvcp90.dll 
  21. 1262 INFO: Searching for file msvcm90.dll 
  22. 1264 INFO: Found file C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_ 
  23. 9.0.21022.8_none_bcb86ed6ac711f91\msvcm90.dll 
  24. 1365 INFO: Analyzing C:\pyinstaller-2.0\support\_pyi_bootstrap.py 
  25. 2440 INFO: Analyzing C:\pyinstaller-2.0\PyInstaller\loader\arcHive.py 
  26. 2552 INFO: Analyzing C:\pyinstaller-2.0\PyInstaller\loader\carchive.py 
  27. 2674 INFO: Analyzing C:\pyinstaller-2.0\PyInstaller\loader\iu.py 
  28. 2705 INFO: Analyzing MonitorWin32Process.py 
  29. 2779 WARNING: pywintypes is changing its name to pywintypes27 
  30. 2871 WARNING: pythoncom is changing its name to pythoncom27 
  31. 3535 INFO: Hidden import 'encodings' has been found otherwise 
  32. 3536 INFO: Looking for run-time hooks 
  33. 3537 INFO: Analyzing rthook C:\pyinstaller-2.0\support/rthooks/pyi_rth_encodings 
  34. .py 
  35. 3621 INFO: Analyzing rthook C:\pyinstaller-2.0\support/rthooks/pyi_rth_versioned 
  36. dll.py 
  37. 3723 INFO: Analyzing rthook C:\pyinstaller-2.0\support/rthooks/pyi_rth_win32comg 
  38. enpy.py 
  39. 3833 INFO: Analyzing rthook C:\pyinstaller-2.0\support/rthooks/pyi_rth_versioned 
  40. dll.py 
  41. 4118 INFO: Adding Microsoft.VC90.MFC to dependent assemblies of final executable 
  42.  
  43. 4192 INFO: Searching for assembly x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.21 
  44. 022.8_none ... 
  45. 4193 INFO: Found manifest C:\Python27\lib\site-packages\Pythonwin\Microsoft.VC90 
  46. .MFC.manifest 
  47. 4195 INFO: Searching for file mfc90.dll 
  48. 4196 INFO: Found file C:\Python27\lib\site-packages\Pythonwin\mfc90.dll 
  49. 4197 INFO: Searching for file mfc90u.dll 
  50. 4197 INFO: Found file C:\Python27\lib\site-packages\Pythonwin\mfc90u.dll 
  51. 4199 INFO: Searching for file mfcm90.dll 
  52. 4200 INFO: Found file C:\Python27\lib\site-packages\Pythonwin\mfcm90.dll 
  53. 4200 INFO: Searching for file mfcm90u.dll 
  54. 4202 INFO: Found file C:\Python27\lib\site-packages\Pythonwin\mfcm90u.dll 
  55. 4856 INFO: Warnings written to C:\pyinstaller-2.0\MonitorWin32Process\build\pyi. 
  56. win32\MonitorWin32Process\warnMonitorWin32Process.txt 
  57. 4866 INFO: checking PYZ 
  58. 4867 INFO: rebuilding out00-PYZ.toc because out00-PYZ.pyz is missing 
  59. 4868 INFO: building PYZ out00-PYZ.toc 
  60. 6252 INFO: checking PKG 
  61. 6253 INFO: rebuilding out00-PKG.toc because out00-PKG.pkg is missing 
  62. 6253 INFO: building PKG out00-PKG.pkg 
  63. 8202 INFO: checking EXE 
  64. 8203 INFO: rebuilding out00-EXE.toc because MonitorWin32Process.exe missing 
  65. 8205 INFO: building EXE from out00-EXE.toc 
  66. 8212 INFO: SRCPATH [('E:\\p_w_picpaths\\96.ico', None)] 
  67. 8231 INFO: Updating icons from ['E:\\p_w_picpaths\\96.ico'] to c:\users\bo\appdata\loc 
  68. al\temp\tmp827iux 
  69. 8232 INFO: Writing RT_GROUP_ICON 0 resource with 76 bytes 
  70. 8233 INFO: Writing RT_ICON 1 resource with 872 bytes 
  71. 8233 INFO: Writing RT_ICON 2 resource with 3240 bytes 
  72. 8235 INFO: Writing RT_ICON 3 resource with 7336 bytes 
  73. 8236 INFO: Writing RT_ICON 4 resource with 12840 bytes 
  74. 8236 INFO: Writing RT_ICON 5 resource with 28840 bytes 
  75. 8266 INFO: Appending archive to EXE C:\pyinstaller-2.0\MonitorWin32Process\dist\ 
  76. MonitorWin32Process.exe 
  77.  
  78. C:\pyinstaller-2.0> 

 正常情况下会在当前目录下,生成与python文件名相同的目录,可执行程序在dist 目录下.

 

  1. -F 生成一个文件及生成一个exe文件 
  2. -W --windowed, --noconsole 使用一个子系统,不使用console及没有那个黑框 
  3. --icon 可自定义图标 

 

--结束END--

本文标题: python 将python程序编译成可

本文链接: https://www.lsjlt.com/news/189442.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • python 将python程序编译成可
    一、使用pyinstaller 完成对python程序到可执行文件转换. 官网: http://www.pyinstaller.org/ 下载与操作系统相匹配的版本. 目前pyinstaller 只支持2.3 - 2.7。 不支持pytho...
    99+
    2023-01-31
    编译成 程序 python
  • 如何将Python程序编译转换成Windows可执行程序的方案
    这篇文章主要介绍“如何将Python程序编译转换成Windows可执行程序的方案”,在日常操作中,相信很多人在如何将Python程序编译转换成Windows可执行程序的方案问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对...
    99+
    2023-06-17
  • 将python程序变成可执行程序
    文章目录 前言一、Pyinstall是什么?二、使用步骤1.ubuntu环境下使用(1)安装(2)打包程序(3)使用 2.在windows环境下使用(1)安装(2)打包程序(3)使用 ...
    99+
    2023-10-04
    python ubuntu linux
  • 怎么将Python编译成C语言
    这篇文章主要为大家展示了“怎么将Python编译成C语言”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“怎么将Python编译成C语言”这篇文章吧。前言:文章里用的Python环境是Anacond...
    99+
    2023-06-29
  • 如何将Python编译成C语言
    前言: 文章里用的Python环境是Anaconda3 2019.7这里测试的程序是找出所有1000以内的勾股数。a∈[1, 1000],b∈[1, 1000],...
    99+
    2024-04-02
  • python怎么编译成可执行文件
    在Python中,可以使用pyinstaller库将Python代码编译成可执行文件,以下是使用pyinstaller的步骤:1. ...
    99+
    2023-08-18
    python
  • 将python程序转换成exe程序
    将python程序转换成exe.一、 先安装python1、首先访问http://www.python.org/download/去下载最新的python版本。2、安装下载包,一路next。3、为计算机添加安装目录搭到环境变量,如图把pyt...
    99+
    2023-01-31
    程序 转换成 python
  • 将python生成的exe文件反编译成py文件的方法
    前言 闲来无事,就喜欢瞎折腾,之前用python打包过exe小工具,然后今天就突然想到,既然能打包,那就肯定能反编译成py文件,为了这个想法,就网上查资料,自己操作了一下,过程参考了文章: https://www.cnblogs.com/s...
    99+
    2023-09-13
    pycharm ide python
  • python将写好的程序打包成exe可执行文件
    目录1、安装pyinstaller2、使用pyinstaller 打包程序2.1 开始打包2.2 查收exe文件前言: 首先 如果你的python是64位的编译器,那么打包的结果就只...
    99+
    2024-04-02
  • 将Python程序打包成exe文件
    我新写了一篇更加完整的文章,与这篇文章相比,它新增了两种打包方式:多python文件打包和含有资源文件的打包方式,具体请戳链接: 用 Pyinstaller 模块将 Python 程序打包成 exe 文件(全网最全面最详细)_小康20...
    99+
    2023-09-05
    python exe pyinstaller
  • 将Python脚本打包成MACOSAPP程序过程
    目录安装py2app打开终端输入pip3命令安装py2app工具配置setup.pysetup.py内有一些app信息的配置生成app还在此前的目录终端下输入命令安装py2app 打...
    99+
    2024-04-02
  • Python将py文件编译为exe文件
    使用PyCharm工具写好的Python程序脚本,怎么将.py文件编译为可执行的.exe文件 前提是已经安装了Python环境。 第一步:在PyCharm内下载安装pyinstall...
    99+
    2024-04-02
  • python如何实现微信小程序反编译
    这篇文章主要介绍“python如何实现微信小程序反编译”,在日常操作中,相信很多人在python如何实现微信小程序反编译问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”python如何实现微信小程序反编译”的疑...
    99+
    2023-06-25
  • python实现微信小程序反编译效果
    对某大神文件进行二次开发实现python实现微信小程序反编译 对于小程序反编译想必大家都不陌生 并且也有许多大神给出了自己的方法 具体可以参考下这篇 可能是我本人技术的问题,很多方法...
    99+
    2024-04-02
  • Python可执行文件反编译教程(exe转py)
    python的便利性,使得如今许多软件开发者、黑客都开始使用python打包成exe的方式进行程序的发布,这类exe有个特点,就是可以使用反编译的方法得到程序的源码,是不是很神奇?我...
    99+
    2024-04-02
  • Python 编译器
    Python 编译器 目录 什么是编译器Python 编译器的发展历程Python 编译器的类型常见的 Python 编译器如何选择 Python 编译器Python Logo 什么是编译器 编译器是...
    99+
    2023-09-20
    python
  • python怎么打包成可执行程序
    要将Python脚本打包成可执行程序,可以使用PyInstaller或cx_Freeze等工具。下面是使用PyInstaller的步...
    99+
    2023-09-15
    python
  • 将vim配置成python编辑器
    参考: 1. Vim与Python真乃天作之合:打造强大的Python开发环境 2. vundle: vim插件管理安装之错误总结 3. 使用vim打造自己的python编辑器 4. 使用v...
    99+
    2023-01-31
    编辑器 vim python
  • pyinstaller将python程序打包为可执行文件
    目录前言pyinstaller简介pyinstaller下载pyinstaller使用准备好程序代码打包程序小结前言 对于专业的python程序员来说,python打包工具或许用得并...
    99+
    2024-04-02
  • Python将脚本程序转变为可执行程序的实现
    类似Java打包操作,若不想让人看到Python程序内部逻辑,也可将其转换为exe可执行文件首先自己写一个Python程序,如下: print("start running..."...
    99+
    2023-02-15
    Python脚本转变为可执行程序 Python 为可执行程序
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作