# -*- coding: utf-8 -*-
import time
def logger():
time_format = ("%Y-%m-%d %X")
time_current = time.strftime(time_format)
with open("logger.txt", "a+",encoding=("utf-8")) as f:
f.write("%s\n这是日志\n" % time_current)
time.sleep(1)
def test1():
print("第一篇日志")
logger()
def test2():
print("第二篇日志")
logger()
def test3():
print("第三篇日志")
logger()
test1()
test2()
test3()
函数调用
猜你喜欢
转载自www.cnblogs.com/hekaiqiaq/p/8855705.html
今日推荐
周排行