增加Makefile

This commit is contained in:
n3040
2022-01-19 10:59:29 +08:00
parent 27730075dc
commit ee2d6477ee
2 changed files with 16 additions and 4 deletions

View File

@@ -1,4 +1,5 @@
import math
import os.path
import sys
import tomli
from loguru import logger
@@ -27,6 +28,9 @@ def egm():
toml_file_path = r"article.toml"
else:
toml_file_path = sys.argv[1]
if not os.path.exists(toml_file_path):
logger.info(f'无法找到数据文件{toml_file_path},程序退出。')
sys.exit(0)
logger.info(f"读取文件{toml_file_path}")
with open(toml_file_path, "rb") as toml_fs:
toml_dict = tomli.load(toml_fs)