用Pyinstaller 实现py.转化为exe可执行文件----二维码实例
1,安装 Pyinstaller
命令提示符窗口:pip install pyinstaller
2,制作二维码脚本 d5_code.py
from MyQR import myqr
#生成二维码
words = input("请输入您要生成二维码的网址:")
#save_name 生成的图片, picture 二维码背景图, colorized 是否开启颜色
# myqr.run(words=words,save_name='mysite.jpg',picture='test_numpy.jpg',colorized=True)
myqr.run(words=words,save_name='QR_code.jpg')
3,打包 Python脚本
在运行 pyinstaller命令需在py同一个目录下
pyinstaller -F d5_code.py
**常用的一些附加:
-D,--onedir 这会创建一个包含可执行文件的单文件夹包(默认)
-F,--onefile 这个只会创建一个可执行文件
--specpath DIR 用于存储生成的spec文件的文件夹(默认值:当前目录)
-n NAME, --name NAME 应用程序的名称(默认值:第一个脚本的名称)
-i FILE.ico , --icon FILE.ico 为你的程序添加一个图标
报错误总结
1. AttributeError: ‘str’ object has no attribute ‘items’
解决方法: 需要更新一下你的setuptools pip install --upgrade setuptools
2,打包后运行.exe程序调试闪退
解决方法:在cmd行里面运行你的.exe文件
用Pyinstaller 实现py.转化为exe可执行文件----二维码实例的更多相关文章
- pyinstaller打包.py程序为.exe操作指南
pyinstaller打包.py程序为.exe操作指南 20190526内容纲要: 1.pyinstaller安装 2.程序封装 3.可执行程序 0 前言 今天第一次试试将一个py程序封装成一个.ex ...
- 使用Pyinstaller转换.py文件为.exe可执行程序
pyinstaller能够在Windows.Linux等操作系统下将Python脚本打包成可直接运行程序.使Python脚本可以在没有安装Python的环境中直接运行,方便共享. 测试环境 pytho ...
- pyinstaller打包py文件成exe文件时,出现ImportError: No module named 'pefile'错误解决办法!
首先pyinstaller的安装与使用详见如下链接: 安装完成之后,命令行中输入pyinstaller之后,结果如下: ImportError: No module named 'pefile' 缺少 ...
- py脚本打包exe可执行文件
python3以上版本打包exe需要扩展软件:cx_freeze 下载地址:http://cx-freeze.sourceforge.net/ 1)安装后在\Python32\Scripts\cxfr ...
- 打包python脚本为exe可执行文件-pyinstaller和cx_freeze示例
本文介绍使用cx_freeze和pyinstaller打包python脚本为exe文件 cx_freeze的使用实例 需要使用到的文件wxapp.py, read_file.py, setup.py ...
- pyinstaller 将.py生成.exe ----报错 “IndexError: tuple index out of range”
pyinstaller将py打包为exe文件,用pysintaller居然报错 File "c:\anaconda3\lib\site-packages\PyInstaller\depend ...
- pyinstaller使用-python项目转换成exe可执行文件
http://blog.csdn.net/pipisorry/article/details/50620122 Python不是每个人的计算机里面都有安装,当您写了一个好用的工具,需要一个standa ...
- 使用pyInstaller发布PathMerge的exe版本(py转换成exe)
前言 PathMerge是用python写的一个辅助文件夹合并的小工具,它的特点是不用担心合并后文件会丢失,旧文件会创建副本保存下来,除非你手动删除. 详情见:python开发目录合并小工具 Path ...
- 如何把py文件打包成exe可执行文件
如何把py文件打包成exe可执行文件 1.安装 pip install pyinstaller 或者 pip install -i https://pypi.douban.com/simple pyi ...
随机推荐
- RDP 数据库简介
在扩增子数据分析中,有时会发现多个OTU 注释到了同一个species , 为什么会出现这种情况呢? 首先既然在OTU水平能分开,说明序列的相似度小于97%, 同一个物种的同一个基因的片段相似度会 ...
- 使用UWA GOT优化Unity性能和内存
优化百科: https://blog.uwa4d.com/archives/Index.html https://blog.uwa4d.com/archives/Introduction_UWAGOT ...
- Java使用SFTP协议上传、下载文件
http://blog.csdn.net/haidage/article/details/6859716 在自己尝试之后发现以上内容里有坑. 1.关闭连接的时候,必须要sftp.getSession( ...
- spray 处理 response 的通用函数
def handleActorResponse: PartialFunction[Try[Any], (StatusCode, ResponseResult)] = { case Failure(ex ...
- C++/MFC-线程优先级
转载: https://blog.csdn.net/qwdpoiguw/article/details/72830426 一.线程优先级(Thread priority ) 简单的说就是(线程)的优先 ...
- element的form表单中如何一行显示多el-form-item标签
效果图: HTML代码: <script src="//unpkg.com/vue/dist/vue.js"></script> <script sr ...
- POJ 2018 Best Cow Fences(二分+最大连续子段和)
Best Cow Fences Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 14601 Accepted: 4720 Desc ...
- Spark Pipeline
一个简单的Pipeline,用作estimator.Pipeline由有序列的stages组成,每个stage是一个Estimator或者一个Transformer. 当Pipeline调用fit,s ...
- ModelAttribue注解的使用
Spring中有很多注解,如RequestParam,PathVarible,SesstionAttribute,这些在开发是多尝试一下,可能用得到,ModelAttribute用的还挺多,可以以此为 ...
- es7 class装饰器
文档http://es6.ruanyifeng.com/#docs/decorator ts文档 https://www.tslang.cn/docs/handbook/decorators.html ...