1、Python生成exe封装
# mysetup.py
from distutils.core import setup
import py2exe
setup(console=["helloworld.py"])
>>>pythonmysetup.py py2exe
2、生成pyc文件
>>> import py_compile
>>> py_compile.compile(r‘T:\编程技术\Python\python\Python\pyoid.py‘)
3、Window平台安装源文件模块
C:>cdC:\Python27\Lib\site-packages\pyasn1-0.1.6
C:\Python27\Lib\site-packages\pyasn1-0.1.6>pythonsetup.py install
注:在cmd命令行运行
类似linux下运行:
$ tarxzf pyasn1-0.1.6.tgz
$ cd pyasn1-0.1.6
$python setup.py install