Initial commit: Carrot Hunter v2 with 20 levels
This commit is contained in:
18
create_zip.py
Normal file
18
create_zip.py
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env python3
|
||||
import zipfile
|
||||
import os
|
||||
|
||||
zip_path = '/home/alex/git/carrot/Carrot_Hunter_Final.zip'
|
||||
source_dir = '/home/alex/git/carrot/Carrot_Hunter_Final'
|
||||
|
||||
with zipfile.ZipFile(zip_path, 'w', zipfile.ZIP_DEFLATED) as zipf:
|
||||
for root, dirs, files in os.walk(source_dir):
|
||||
for file in files:
|
||||
file_path = os.path.join(root, file)
|
||||
arcname = os.path.relpath(file_path, os.path.dirname(source_dir))
|
||||
zipf.write(file_path, arcname)
|
||||
print(f'✓ {arcname}')
|
||||
|
||||
size = os.path.getsize(zip_path) / 1024
|
||||
print(f'\n✓ ZIP-fil lavet: {zip_path}')
|
||||
print(f'✓ Størrelse: {size:.1f} KB')
|
||||
Reference in New Issue
Block a user