有些不能成功,有些不全的,下面总结一下,给自己以后看看。
1下载PyInstaller。。去官网下载http://www.pyinstaller.org/(我下载的版本)
2不需要安装,解压即可。如解压到D盘。
3进入cmd下面,
进入解压的文件下
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下写下面的语句。
参考(2)
会出下如下结果
。。。略
6在D:\PyInstaller-2.1\hello\dist\hello下面的exe就是可执行文件了
参考1:http://huangliangnumber1.blog.163.com/blog/static/47811748201142282435469/
参考2:http://outofmemory.cn/code-snippet/2041/usage-pyinstaller-dabao-python-exe-file