时间监测以及简单函数封装以及返回值

import  time
with open('db.txt',mode='at',encoding='utf_8') as f:
f.write('%s xiayu\n'%time.strftime('%Y-%m-%d %X'))
with open('db.txt',mode='rb') as f :
f.seek(0,2)
while True:
line=f.readline()
if len(line) == 0:
continue
else:
print(line.decode('utf_8'),end='|')


#
# def max2(x,y):
# if x>y:
# return x
# else:
# return y
#
# res=max2(20,30)
# print(res*12)
posted @ 2018-09-21 12:00  路口有雾  阅读(237)  评论(0编辑  收藏  举报