Skip to content

Instantly share code, notes, and snippets.

@fuwiak
Created May 28, 2023 09:06
Show Gist options
  • Save fuwiak/0e4ec33e00be0a076e971c5fc4212a7e to your computer and use it in GitHub Desktop.
Save fuwiak/0e4ec33e00be0a076e971c5fc4212a7e to your computer and use it in GitHub Desktop.
import os
import sys
# Pobierz aktualną ścieżkę do bieżącego pliku
current_path = os.path.dirname(os.path.abspath(__file__))
# Dodaj dwa poziomy wyżej do ścieżki
two_levels_up = os.path.abspath(os.path.join(current_path, "../../"))
# Dodaj nową ścieżkę do sys.path, aby Python mógł znaleźć moduł
sys.path.append(two_levels_up)
# Zaimportuj moduł
import modul
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment