- 时间:2020-10-18 21:01 编辑: 来源: 阅读:
- 扫一扫,手机访问
摘要:零基础写python爬虫之打包生成exe文件
1.下载pyinstaller并解压(可以去官网下载最新版):
[url=https://github.com/pyinstaller/pyinstaller/]https://github.com/pyinstaller/pyinstaller/[/url]
2.下载pywin32并安装(注意版本,我的是python2.7):
[url=https://pypi.python.org/pypi/pywin32]https://pypi.python.org/pypi/pywin32[/url]
3.将项目文件放到pyinstaller文件夹下面(我的是baidu.py):
[img]http://files.jb51.net/file_images/article/201411/201411061059038.png[/img]
4.按住shift键右击,在当前路径打开命令提示行,输入以下内容(最后的是文件名):
python pyinstaller.py -F baidu.py
5.生成的exe文件,在baidu文件夹下的dist文件夹中,双击即可运行:
[img]http://files.jb51.net/file_images/article/201411/201411061059039.png[/img]