主页
Python
Python zipfile 模块
demo_ref_module_zipfile_basic
运行 ❯
×
更改方向
保存代码
更改主题
import zipfile with zipfile.ZipFile('example.zip', 'w') as myzip: myzip.writestr('hello.txt', 'Hello, Emil!') myzip.writestr('data.txt', 'Some data here') print('ZIP file created successfully')
ZIP file created successfully