File size: 243 Bytes
3a5cf48
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
import time
# 每秒往文件中写入一条数据,模拟测试
_rCmd_log = '/tmp/dockerRun.log'

while True:
    with open(_rCmd_log, 'a+') as f:
        f.write(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) + '\n')
    time.sleep(1)