Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import zipfile
|
| 2 |
+
import os
|
| 3 |
+
|
| 4 |
+
# Specify the path to the .zip file
|
| 5 |
+
zip_file_path = "cspc_db.zip"
|
| 6 |
+
|
| 7 |
+
# Specify the directory where you want to extract the files
|
| 8 |
+
extract_to_path = "cspc_db"
|
| 9 |
+
|
| 10 |
+
# Check if the destination directory exists, and if not, create it
|
| 11 |
+
if not os.path.exists(extract_to_path):
|
| 12 |
+
os.makedirs(extract_to_path)
|
| 13 |
+
|
| 14 |
+
# Unzip the file
|
| 15 |
+
with zipfile.ZipFile(zip_file_path, 'r') as zip_ref:
|
| 16 |
+
zip_ref.extractall(extract_to_path)
|
| 17 |
+
|
| 18 |
+
print(f"Files have been extracted to: {extract_to_path}")
|