41 lines
1.1 KiB
Python
41 lines
1.1 KiB
Python
# daj_no_Plik.py (wersja lokalna)
|
|
import os
|
|
import zipfile
|
|
import requests
|
|
from pathlib import Path
|
|
|
|
|
|
def download_from_url(url, save_path):
|
|
"""Pobiera plik z URL"""
|
|
print(f"Pobieranie z {url}...")
|
|
response = requests.get(url, stream=True)
|
|
|
|
with open(save_path, 'wb') as f:
|
|
for chunk in response.iter_content(chunk_size=8192):
|
|
f.write(chunk)
|
|
|
|
print(f"Zapisano do {save_path}")
|
|
|
|
|
|
def main():
|
|
# Jeśli masz plik .zip na dysku
|
|
zip_path = "/ścieżka/do/Pathl_AI.zip"
|
|
|
|
if os.path.exists(zip_path):
|
|
print("Rozpakowywanie...")
|
|
with zipfile.ZipFile(zip_path, 'r') as zip_ref:
|
|
zip_ref.extractall("Pathl.AI")
|
|
print("✅ Gotowe!")
|
|
else:
|
|
print("❌ Plik nie istnieje")
|
|
print("\n📥 Pobierz plik z Google Colab:")
|
|
print("1. W Colab uruchom:")
|
|
print(" from google.colab import files")
|
|
print(" files.download('/content/Pathl_AI.zip')")
|
|
print("2. Pobierz plik na komputer")
|
|
print("3. Uruchom ten skrypt ponownie")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
print("plik")
|
|
main() |