1 Star 4 Fork 0

sunfkny/genshin-gacha-export

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
utils.py 909 Bytes
一键复制 编辑 原始数据 按行查看 历史
sunfkny 提交于 2023-07-16 21:59 . fix pylance error
import sys
import platform
import traceback
import pathlib
from loguru import logger
open("log.txt", "w").close()
logger.configure(
handlers=[
{"sink": sys.stdout, "level": "INFO"},
{"sink": "log.txt", "level": "DEBUG"},
]
)
def press_any_key_to_exit(msg="执行结束,按任意键退出"):
from sys import exit
logger.info(msg)
try:
if platform.system() == "Windows":
from msvcrt import getch
getch()
else:
input()
except KeyboardInterrupt:
exit()
except Exception:
logger.error(traceback.format_exc())
exit()
gen_path = pathlib.Path(sys.argv[0]).parent
config_path = gen_path / "config.json"
gacha_report_path = gen_path / "gachaReport.html"
logger.debug("gen_path: {}", gen_path)
logger.debug("config_path: {}", config_path)
logger.debug("gachaReportPath: {}", gacha_report_path)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sunfkny/genshin-gacha-export.git
git@gitee.com:sunfkny/genshin-gacha-export.git
sunfkny
genshin-gacha-export
genshin-gacha-export
main

搜索帮助