对于python脚本,输出语句
print 'hello'
与python语句是一致的
sys.stdout.write('hello'+'\n')
这里仅仅只是将数据输出到了缓冲区,还没有到shell终端
print 'hello'
sys.stdout.flush()
这样就可以直接将输出数据输出到终端。
脚本运行时间较短还可以,但是较长的时候,则需要实时输出数据,监控log日志的输出。
对于python脚本,输出语句
print 'hello'
与python语句是一致的
sys.stdout.write('hello'+'\n')
这里仅仅只是将数据输出到了缓冲区,还没有到shell终端
print 'hello'
sys.stdout.flush()
这样就可以直接将输出数据输出到终端。
脚本运行时间较短还可以,但是较长的时候,则需要实时输出数据,监控log日志的输出。