mirror of
https://github.com/yv1ing/MollyAudit.git
synced 2025-09-16 14:55:50 +08:00
Fixed some bugs and packaged them into executable files
This commit is contained in:
10
main.py
10
main.py
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user