import os
os.popen("tail -f /root/projects/***/***/logs/application.log")
<open file 'tail -f /root/projects/***/***/logs/application.log', mode 'r' at 0x7f36bd7c9390>
1
aias OP os.popen("tail -f /root/projects/***/***/logs/application.log",“ r ”)直接没反应了..
|
2
aias OP 还是不行..
|
3
binux 2016-05-17 18:03:06 +08:00
In [1]: import os
In [2]: f = os.popen("tail -f ./domains.txt") In [3]: f.readline() Out[3]: 'www.thephonebook.bt.com\n' In [4]: f.read(10) Out[4]: 'www.chambe' In [5]: f.readline() Out[5]: 'rofcommerce.com\n' |