From 28ebfa284c400a1032891c2208bc953afbf11e50 Mon Sep 17 00:00:00 2001 From: Matthew Champagne Date: Thu, 19 Oct 2023 13:47:33 -0400 Subject: [PATCH] Fixed the file path to work on windows and linux --- src/ui_main.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ui_main.py b/src/ui_main.py index 92197c9..65dcc71 100644 --- a/src/ui_main.py +++ b/src/ui_main.py @@ -4,6 +4,7 @@ # IMPORTS import sys import glob +import os try: import serial @@ -78,7 +79,13 @@ def __init__(self): """ Initialize Main Window """ QMainWindow.__init__(self) - loadUi('..\\ui\\main_window.ui', self) + file_path = os.path.join("../ui/main_window.ui") + + if not os.path.exists(file_path): + print("UI File Not Found!") + sys.exit(1) + + loadUi(file_path, self) PORTS = get_serial_port()