有些不能成功,有些不全的,下面总结一下,给自己以后看看。

 

1下载PyInstaller。。去官网下载http://www.pyinstaller.org/(我下载的版本)

 

2不需要安装,解压即可。如解压到D盘。

 

3进入cmd下面,

利用PyInstaller将python代码封装成EXE(亲测可用)

进入解压的文件下

利用PyInstaller将python代码封装成EXE(亲测可用)

 

4  写一个测试文件保存在D盘下,命名为Hello(参考1)

# -*- coding: utf-8 -*-
"""
Created on Thu Mar 13 14:00:26 2014

@author: Administrator
"""

#!/usr/bin/env python
print 'Hello,World!'
words = raw_input('What do you want to say? ')
print 'you said:'+words

 

 

5执行封装:在cmd下写下面的语句。利用PyInstaller将python代码封装成EXE(亲测可用)

参考(2)

利用PyInstaller将python代码封装成EXE(亲测可用)

 

会出下如下结果

利用PyInstaller将python代码封装成EXE(亲测可用)。。。略

 

 

6在D:\PyInstaller-2.1\hello\dist\hello下面的exe就是可执行文件了利用PyInstaller将python代码封装成EXE(亲测可用)

 

 

 

参考1:http://huangliangnumber1.blog.163.com/blog/static/47811748201142282435469/

参考2:http://outofmemory.cn/code-snippet/2041/usage-pyinstaller-dabao-python-exe-file

相关文章:

  • 2021-11-16
  • 2022-12-23
  • 2021-07-26
  • 2022-12-23
  • 2022-12-23
  • 2022-02-10
  • 2021-05-21
  • 2021-09-24
猜你喜欢
  • 2021-11-20
  • 2022-01-11
  • 2021-07-29
  • 2022-12-23
  • 2021-10-08
  • 2022-01-25
  • 2021-09-18
相关资源
相似解决方案