Fixed some bugs and packaged them into executable files

This commit is contained in:
2025-02-09 22:31:17 +08:00
parent 0a9f6d7fcd
commit 46c4928b87
6 changed files with 19 additions and 5 deletions

10
main.py
View File

@@ -1,4 +1,6 @@
import sys
import os
from PyQt6.QtGui import QIcon
from PyQt6.QtWidgets import QApplication
from app import load_config
from app.ui import MainWindow
@@ -6,6 +8,13 @@ from app.ui import MainWindow
app = QApplication(sys.argv)
def resource_path(relative_path):
try:
base_path = sys._MEIPASS
except AttributeError:
base_path = os.path.abspath(".")
return os.path.join(base_path, relative_path)
def main():
try:
app.exec()
@@ -19,6 +28,7 @@ if __name__ == '__main__':
load_config()
window = MainWindow()
window.setWindowIcon(QIcon(resource_path('logo.ico')))
window.show()
sys.exit(main())