84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
想做一个简易的数据监控程序,命令行界面。python每秒取数据 展示在命令行中,
但是有两个小需求 不知怎么实现 不想要屏幕滚动输出想把屏幕固定,每秒更新命令行中的数据。
什么思路请指点下?
学习是最好的投资!
You may want the effect of top or watch command.
Suppose your script is called test.py
You only need to execute watch -n 1 "python test.py"
You can run watch -n 1 "date" to see the effect
Reference:http://stackoverflow.com/ques...
If you don’t want the screen to scroll but want to see the output, I think you may need to use 'r' instead of 'n'
You may want the effect of top or watch command.
Suppose your script is called test.py
You only need to execute watch -n 1 "python test.py"
You can run watch -n 1 "date" to see the effect
Reference:
http://stackoverflow.com/ques...
If you don’t want the screen to scroll but want to see the output, I think you may need to use 'r' instead of 'n'