def write_log(*args):
from time import strftime
ymd = strftime('%Y%m%d')
with open('log%s.txt' % ymd, 'a', encoding='utf-8') as f:
for i in args:
f.write('%r\n' % i)
f.write('\n')
Python自定义写日志
猜你喜欢
转载自blog.csdn.net/Yellow_python/article/details/81410848
今日推荐
周排行