pyinstaller打包文件
打包命令 pyinstaller可以将python代码打包为可执行的exe文件,一般应用只需要使用如下命令: C:\Python27\python.exe C:\pyinstaller-2.0\pyinstaller.py src\wgClient.py 执行该命令后将在当前目录下生成build和dist文件夹,另外还会生成一个wgClient.spec文件,用于描述pyinstall的打包过程,如果对打包有特殊要求时,可以直接编辑spec文件,然后将spec文件作为打包时的输入对象: C:\Python27\python.exe C:\pyinstaller-2.0\pyinstaller.py wgClient.spec spec文件 下面附上一段spec文件的示例代码,结合示例说明一些打包过程中的一些特殊要求: # -*- mode: python -*- a = Analysis(['src\\wgClient.py'], pathex=['D:\\PycharmProjects\\wgClientPy'], hiddenimports=[], hookspath=None) pyz = PYZ(a.pure) exe = EXE(pyz, a.scripts, a.binaries, a.zipfiles, a.datas, [('logging.conf', 'src