修复:第一次运行时,无法找到 questions.csv
This commit is contained in:
10
ui/main.py
10
ui/main.py
@@ -1,7 +1,6 @@
|
||||
import os
|
||||
import platform
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
from PySide6.QtCore import QObject, QThread, Signal
|
||||
@@ -10,14 +9,7 @@ from PySide6.QtWidgets import QMainWindow, QFileDialog
|
||||
from module.doc import DocPaper
|
||||
from module.schema import Course, Student, Question
|
||||
from ui.pyui.main import Ui_MainWindow
|
||||
|
||||
|
||||
def resource_path(relative_path: str) -> str:
|
||||
if hasattr(sys, '_MEIPASS'):
|
||||
base_path = sys._MEIPASS
|
||||
else:
|
||||
base_path = os.path.abspath(".")
|
||||
return os.path.join(base_path, relative_path)
|
||||
from utils.function import resource_path
|
||||
|
||||
|
||||
class Worker(QObject):
|
||||
|
||||
Reference in New Issue
Block a user