-00.pyz'? o PYZ-00.pyzContents of 'PYZ-00.pyz' (PYZ): is_package, position, length, name 0, 17, 2647, '_compat_pickle /main.exe_extracted/PYZ-00.pyz_extracted"for pyc_file in os.listdir(pyz_dir): if pyc_file.endswith # 补全非入口类文件pyz_dir = "main.exe_extracted/PYZ-00.pyz_extracted"for pyc_file in os.listdir(pyz_dir): Cannot extract PYZ-00.pyz.
INFO: Graph cross-reference written to D:\pyinstaller\build\hello\xref-hell o.html 6357 INFO: checking PYZ 6358 INFO: Building PYZ because PYZ-00.toc is non existent 6359 INFO: Building PYZ (ZlibArchive) D:\ pyinstaller\build\hello\PYZ-00.pyz 7000 INFO: Building PYZ (ZlibArchive) D:\pyinstaller\build\hello\PYZ -00.pyz comp leted successfully. 7006 INFO: checking PKG 7007 INFO: Building PKG because PKG-00.toc is
INFO: Graph cross-reference written to D:\pyinstaller\build\hello\xref-hell o.html 6357 INFO: checking PYZ 6358 INFO: Building PYZ because PYZ-00.toc is non existent 6359 INFO: Building PYZ (ZlibArchive) D:\ pyinstaller\build\hello\PYZ-00.pyz 7000 INFO: Building PYZ (ZlibArchive) D:\pyinstaller\build\hello\PYZ -00.pyz comp leted successfully. 7006 INFO: checking PKG 7007 INFO: Building PKG because PKG-00.toc is
4、在目录下生成反编译后的文件:xx.exe_extracted 生成拆解目录如下: --- xxx.exe_extracted -- out00-PYZ.pyz_extracted - 各种.pyc文件 -- out00-PYZ.pyz -- some -- others -- xxx(注意这些都是没后缀的) 5、PYZ-00.pyz_extracted文件夹内是
open embedded archive name X <name>: extract name Q: quit 然后可以提取出指定需要提取的文件: 要提取其他被导入的pyc文件,则需要先打开PYZ -00.pyz: 很显然,使用PyInstaller的pyi-archive_viewer 工具操作起来比较麻烦,一次只能提取一个文件,遇到子模块还需执行一次打开操作。 这里我们选择第13个字节再插入四个字节即可: 然后再执行: uncompyle6 auto_organize_gui.exe_extracted/PYZ-00.pyz_extracted/auto_organize.pyc 目录抽取的pyc文件的前4个字节作基准: pyz_dir = f"{pyc_dir}/PYZ-00.pyz_extracted" for pyc_file in os.listdir(pyz_dir): = f"{pyc_dir}/PYZ-00.pyz_extracted" for pyc_file in os.listdir(pyz_dir): pyc_file_src = f"{pyz_dir
win32\MonitorWin32Process\warnMonitorWin32Process.txt 4866 INFO: checking PYZ 4867 INFO: rebuilding out00-PYZ.toc because out00-PYZ.pyz is missing 4868 INFO: building PYZ out00-PYZ.toc 6252 INFO: checking
• 保存和加载Python对象 • 临时存储数据 优缺点 优点: • 序列化和反序列化非常简单 • 可以存储几乎任何Python对象 缺点: • 不适合长期存储 • 存在安全风险,易受攻击 10. .pyz 文件 .pyz 文件是压缩的Python程序,可以将多个Python文件打包成一个归档文件~ 代码案例 生成 .pyz 文件: zipapp -o myapp.pyz -m 'mymodule:main ' mymodule/ 运行 .pyz 文件: python myapp.pyz 常用场景 • 发布单文件应用 • 简化部署 优缺点 优点: • 所有文件打包在一起,方便管理 • 简化分发和部署 缺点: • 不易调试 • 需要支持 .pyz 的Python版本 常见文件格式转换 .py 转 .pyc 可以使用Python自带的compileall模块: python -m compileall your_script.py
win_no_prefer_redirects=False, win_private_assemblies=False, cipher=block_cipher) pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) exe = EXE(pyz, a.scripts,
win_private_assemblies=False, cipher=block_cipher, noarchive=False) pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) 第四个参数,datas=[]。 win_no_prefer_redirects=False, win_private_assemblies=False, cipher=block_cipher) pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) exe = EXE(pyz, a.scripts, exe = EXE(pyz, a.scripts, a.binaries, a.zipfiles, a.datas,
hanruikai/eclipse-workspace/build/ReadCreditCardExcel/xref-ReadCreditCardExcel.html 4638 INFO: checking PYZ 4638 INFO: Building PYZ because out00-PYZ.toc is non existent 4638 INFO: Building PYZ (ZlibArchive) /Users/hanruikai/eclipse-workspace/build/ReadCreditCardExcel/out00-PYZ.pyz 5023 INFO: Building PYZ (ZlibArchive ) /Users/hanruikai/eclipse-workspace/build/ReadCreditCardExcel/out00-PYZ.pyz completed successfully.
Graph cross-reference written to C:\Users\张小胖\Desktop\build\demo\xref-demo.html 7130 INFO: checking PYZ 7130 INFO: Building PYZ because PYZ-00.toc is non existent 7134 INFO: Building PYZ (ZlibArchive) C:\ Users\张小胖\Desktop\build\demo\PYZ-00.pyz 7971 INFO: Building PYZ (ZlibArchive) C:\Users\张小胖\Desktop\build \demo\PYZ-00.pyz completed successfully. 7989 INFO: checking PKG 7989 INFO: Building PKG because PKG-
written to /home/dechin/projects/2021-python/installer/build/pye/xref-pye.html 6361 INFO: checking PYZ 6361 INFO: Building PYZ because PYZ-00.toc is non existent 6361 INFO: Building PYZ (ZlibArchive) /home /dechin/projects/2021-python/installer/build/pye/PYZ-00.pyz 6647 INFO: Building PYZ (ZlibArchive) /home /dechin/projects/2021-python/installer/build/pye/PYZ-00.pyz completed successfully. 6649 INFO: checking -00.pyz │ ├── PYZ-00.toc │ ├── Tree-00.toc │ ├── Tree-01.toc │ ├── Tree-02.toc
cross-reference written to Q:\PyWorkSpace\LearnPython\build\sendemail\xref-sendemail.html 11888 INFO: checking PYZ 11888 INFO: Building PYZ because out00-PYZ.toc is non existent 11888 INFO: Building PYZ (ZlibArchive ) Q:\PyWorkSpace\LearnPython\build\sendemail\out00-PYZ.pyz 12544 INFO: Building PYZ (ZlibArchive) Q:\ PyWorkSpace\LearnPython\build\sendemail\out00-PYZ.pyz completed successfully. 12555 INFO: checking PKG
win_no_prefer_redirects=False, win_private_assemblies=False, cipher=block_cipher, noarchive=False, ) pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) exe = EXE( pyz, a.scripts, a.binaries
written to /home/dechin/projects/2021-python/installer/build/pye/xref-pye.html 6361 INFO: checking PYZ 6361 INFO: Building PYZ because PYZ-00.toc is non existent 6361 INFO: Building PYZ (ZlibArchive) /home /dechin/projects/2021-python/installer/build/pye/PYZ-00.pyz 6647 INFO: Building PYZ (ZlibArchive) /home /dechin/projects/2021-python/installer/build/pye/PYZ-00.pyz completed successfully. 6649 INFO: checking -00.pyz │ ├── PYZ-00.toc │ ├── Tree-00.toc │ ├── Tree-01.toc │ ├── Tree-02.toc
win_private_assemblies=False, cipher=block_cipher, noarchive=False) pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) exe = EXE(pyz, a.scripts,
to C:\Users\MQiuj\PycharmProjects\pythonProject\build\20231207\xref-20231207.html2982 INFO: checking PYZ2983 INFO: Building because toc changed2983 INFO: Building PYZ (ZlibArchive) C:\Users\MQiuj\PycharmProjects \pythonProject\build\20231207\PYZ-00.pyz3257 INFO: Building PYZ (ZlibArchive) C:\Users\MQiuj\PycharmProjects \pythonProject\build\20231207\PYZ-00.pyz completed successfully.3288 INFO: checking PKG3288 INFO: Building
main File "<string>", line 20, in __init__ File "h:\workspace\project\build\pyi.win32\mrdj\outPYZ1.pyz _core", line 7978, in __init__ File "h:\workspace\project\build\pyi.win32\mrdj\outPYZ1.pyz/wx. twisted.internet.wxreactor", line 175, in install File "h:\workspace\project\build\pyi.win32\mrdj\outPYZ1.pyz _threadedselect", line 106, in __init__ File "h:\workspace\project\build\pyi.win32\mrdj\outPYZ1.pyz twisted.internet.base", line 488, in __init__ File "h:\workspace\project\build\pyi.win32\mrdj\outPYZ1.pyz
\dist) --workpath WORKPATH Where to put all the temporary work files, .log, .pyz Graph cross-reference written to C:\Python27\test\build\command\xref-command.html 3384 INFO: checking PYZ 3384 INFO: Building PYZ because out00-PYZ.toc is non existent 3387 INFO: Building PYZ (ZlibArchive) C:\Python27\test\build\command\out00-PYZ.pyz 3607 INFO: Building PYZ (ZlibArchive) C:\Python27\test\build \command\out00-PYZ.pyz completed successfully. 3637 INFO: checking PKG 3639 INFO: Building PKG because
Graph cross-reference written to C:\python36\Scripts\build\nhrp\xref-nhrp.html 5297 INFO: checking PYZ 5298 INFO: Building PYZ because out00-PYZ.toc is non existent 5299 INFO: Building PYZ (ZlibArchive) C:\python36\Scripts\build\nhrp\out00-PYZ.pyz 5814 INFO: Building PYZ (ZlibArchive) C:\python36\Scripts \build\nhrp\out00-PYZ.pyz completed successfully. 5819 INFO: checking PKG 5820 INFO: Building PKG because