From b0232eae207032b87bb78da3816ea3a2c335a64e Mon Sep 17 00:00:00 2001 From: ClarkFieseln <54716944+ClarkFieseln@users.noreply.github.com> Date: Sun, 29 Aug 2021 09:14:06 +0200 Subject: [PATCH] Update mainWindow.py --- ui/mainWindow.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ui/mainWindow.py b/ui/mainWindow.py index 59a692e..7a2cedb 100644 --- a/ui/mainWindow.py +++ b/ui/mainWindow.py @@ -35,6 +35,14 @@ root = tkinter.Tk() root.withdraw() +# different relative paths depending if we run the script or the executable file +runningScript = os.path.basename(__file__) +if (runningScript=="mainWindow.py"): + # .py script + # go to current file path + os.chdir(os.path.dirname(__file__)) + # now go one level up so configuration.PATH_PREFIX is correct again (we are now in folder /ui) + os.chdir("../") # defines for chat state machine CHAT_STATE_OFF = "off"