想做一个简易的数据监控程序,命令行界面。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'