修复:第一次运行时,无法找到 questions.csv

This commit is contained in:
2025-05-18 12:02:35 +08:00
parent 6961b70a7d
commit 83b3790e8b
3 changed files with 13 additions and 10 deletions

10
utils/function.py Normal file
View File

@@ -0,0 +1,10 @@
import os
import sys
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)