修改部分说明文件,提供了命令行操作的支持

This commit is contained in:
2021-12-12 17:50:41 +08:00
parent 737ec6a1be
commit 71d445d255
6 changed files with 400 additions and 7 deletions

View File

@ -7,10 +7,11 @@ StrStartTime = str(datetime.datetime.now()).replace(':', '_')[:-7]
'''字符串型的程序开始时间'''
def log(info:str = ''):
def log(info:str = '',isPrinted:bool = True):
'''将信息连同当前时间载入日志'''
if not os.path.exists('./log/'):
os.makedirs('./log/')
with open('./log/'+StrStartTime+'.msct.log', 'a',encoding='UTF-8') as f:
f.write(str(datetime.datetime.now())[11:19]+' '+info+'\n')
print(str(datetime.datetime.now())[11:19]+' '+info)
if isPrinted:
print(str(datetime.datetime.now())[11:19]+' '+info)