Datasets:

File size: 621 Bytes
9ab2868
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import os
import shutil
import zipfile

# Ensure the data directory exists
os.makedirs('data', exist_ok=True)

# List of files to copy and compress
files = ['questions.json', 'questions_aux.json']

for file in files:
    # Source and destination paths
    src_path = os.path.join('old_data', file)
    dst_path = os.path.join('data', file + '.zip')

    # Copy and compress the file
    with zipfile.ZipFile(dst_path, 'w', zipfile.ZIP_DEFLATED) as zipf:
        zipf.write(src_path, arcname=file)

    print(f"Copied and compressed {file} to {dst_path}")

print("All files have been copied and compressed successfully.")