You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
373 B

2 years ago
import datetime
import time
# 黄海定义的输出信息的办法,带当前时间
def logInfo(msg):
i = datetime.datetime.now()
print(" %s %s" % (i, msg))
if __name__ == '__main__':
cnt = 0
while True:
logInfo("我还活着!")
time.sleep(1)
cnt = cnt + 1
if cnt == 30:
break