derrickx 1 рік тому
батько
коміт
105ddbb378
2 змінених файлів з 7 додано та 1 видалено
  1. 6 0
      dist/results/2024-05-27.txt
  2. 1 1
      main.py

+ 6 - 0
dist/results/2024-05-27.txt

@@ -0,0 +1,6 @@
+abcd, 你好abcd, 你好
+abcd, 你好
+abcd, 你好
+abcd, 你好
+abcd, 你好
+12

+ 1 - 1
main.py

@@ -138,7 +138,7 @@ class MainWindow(QMainWindow, Ui_menu):
         # 获取项目当前路径
         current_path = sys.path[0]
         # 拼接 txt 文件路径
-        file_path = f"{current_path}/results/2024-05-27.txt"
+        file_path = get_resource_path("results/2024-05-27.txt")
         try:
             QDesktopServices.openUrl(QUrl.fromLocalFile(file_path))
         except Exception as e: