From 78eeeac7bd114163418bf5da2897aed62794a09f Mon Sep 17 00:00:00 2001 From: Aineopintojen-harjoitustyo-Algoritmit-j Date: Sat, 17 Feb 2024 10:06:54 +0200 Subject: Root directory can be now run in any cwd. --- __main__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/__main__.py b/__main__.py index 4a91b1e..c8fa693 100644 --- a/__main__.py +++ b/__main__.py @@ -1,3 +1,6 @@ """ __main__.py - Käynnistellään ohjelma src/miinaharava kansiosta """ from runpy import run_path -run_path("src/miinaharava", run_name="miinaharava") +from pathlib import Path + +my_path = Path(__file__).parent.resolve() +run_path(f"{my_path}/src/miinaharava", run_name="miinaharava") -- cgit v1.2.3