1. 使用說明html
以例子說明:python
有以下層次結構的腳本文件:windows
main.py/.net
mod/命令行
    __init__.pycode
    module_a.pyhtm
    module_b.pyip
    module_c.pyutf-8
mod1/rpc
    __init__.py
    module_a.py
    module_b.py
直接使用cxfreeze命令行轉化爲二進制格式:
cxfreeze main.py --target-dir main
其餘的選項可使用cxfreeze –help 或者進入
http://cx-freeze.readthedocs.org/en/latest/script.html#cmdoption--include-path
查看選項意義
main.py:
#!/usr/bin/python #-*- coding: utf-8 -*- import modfrom mod.module_a import *from mod.module_b import *from mod.module_c import * import mod1from mod1.module_a import *from mod1.module_b import * #from mod import *if __name__ == '__main__': mod.module_a.hello_a() mod.module_b.hello_b() mod.module_c.hello_c() mod1.module_a.mod1_hello_a() mod1.module_b.mod1_hello_b()print('main over')
下載地址
http://sourceforge.net/projects/cx-freeze/files/4.3.1/
2. 注意事項
在windows上使用時生成的exe可能須要msvcrxx.dll的支持