Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def log(*args, **kwargs):
- # time.time() 返回 unix time
- # 如何把 unix time 转换为普通人类可以看懂的格式呢?
- format = '%H:%M:%S'
- value = time.localtime(int(time.time()))
- dt = time.strftime(format, value)
- with open('log.gua.txt', 'a', encoding='utf-8') as f:
- print(dt, *args, file=f, **kwargs)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement