first commit
This commit is contained in:
25
main.py
Normal file
25
main.py
Normal file
@@ -0,0 +1,25 @@
|
||||
import os
|
||||
import shutil
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
from PySide6.QtWidgets import QApplication
|
||||
|
||||
from ui.main import MainWindow
|
||||
|
||||
appdata_dir = Path(os.environ["APPDATA"])
|
||||
dtg_dir = appdata_dir / "dtg"
|
||||
target_csv = dtg_dir / "questions.csv"
|
||||
|
||||
if not target_csv.exists():
|
||||
dtg_dir.mkdir(parents=True, exist_ok=True)
|
||||
source_csv = Path("template/questions.csv")
|
||||
if not source_csv.exists():
|
||||
raise FileNotFoundError(f"源文件不存在:{source_csv.resolve()}")
|
||||
shutil.copy(source_csv, target_csv)
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = QApplication(sys.argv)
|
||||
window = MainWindow()
|
||||
window.show()
|
||||
sys.exit(app.exec())
|
||||
Reference in New Issue
Block a user