function call

# -*- 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 \nThis is the log \n " % time_current)
time.sleep( 1)

def test1():
print( "The first log ")
logger()


def test2():
print( "The second log ")
logger()


def test3():
print( "The third log ")
logger()

test1()
test2()
test3()

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324436175&siteId=291194637