Skip to content

Commit

Permalink
씨발 도대체 왜 다시 켜지는거지
Browse files Browse the repository at this point in the history
  • Loading branch information
C4NU committed Sep 30, 2023
1 parent eb4d6d2 commit 4d4a4c8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions app_window/webp_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,27 @@
from user_config import UserConfig

if platform.system() == "Windows":
form = os.path.join(os.getcwd(), "Resources/WebPConverterGUI.ui")
program_exec_path = os.getcwd()
form = os.path.join(program_exec_path, "Resources/WebPConverterGUI.ui")
else:
# build 완료된 exec 에서는 실행이 되지만, 단순 py 로 실행할때는 라이브러리 경로를 참조함
form = os.path.join(os.path.dirname(sys.executable), "Resources/WebPConverterGUI.ui")
program_exec_path = os.path.dirname(sys.executable)
form = os.path.join(program_exec_path, "Resources/WebPConverterGUI.ui")

try:
formClass = uic.loadUiType(form)[0]
except:
formClass = uic.loadUiType(os.path.join(os.getcwd(), "Resources/WebPConverterGUI.ui"))[0]
formClass = uic.loadUiType(os.path.join(program_exec_path, "Resources/WebPConverterGUI.ui"))[0]

if platform.system() == "Windows":
sample_file_path = os.path.join(os.getcwd(), "Resources/")
sample_file_path = os.path.join(program_exec_path, "Resources/")
else:
# build 완료된 exec 에서는 실행이 되지만, 단순 py 로 실행할때는 라이브러리 경로를 참조함
sample_file_path = os.path.join(os.path.dirname(sys.executable), "Resources/")
sample_file_path = os.path.join(program_exec_path, "Resources/")
if Path(sample_file_path+"Sample.jpg").is_file() == True:
print("Sample File Exists")
else:
sample_file_path = os.path.join(os.getcwd(), "Resources/")
sample_file_path = os.path.join(program_exec_path, "Resources/")

print("UI Loaded")

Expand Down

0 comments on commit 4d4a4c8

Please sign in to comment.