函数调用
2018-04-16 14:26 何小六soso 阅读(164) 评论(0) 编辑 收藏 举报# -*- 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()