import time
def logger_test():
time_format = '%Y-%m-%d %X'
time_current = time.strftime(time_format)
with open('a.txt', 'a+') as f:
f.write('%s end action\n' %time_current)
def test1():
print('test1 starting action...')
logger_test()
def test2():
print('test2 starting action...')
logger_test()
def test3():
print('test3 starting action...')
logger_test()
test1()
test2()
test3()
转载请注明原文地址:https://ipadbbs.8miu.com/read-63696.html