想做一个简易的数据监控程序,命令行界面。
python每秒取数据 展示在命令行中,
但是有两个小需求 不知怎么实现 不想要屏幕滚动输出想把屏幕固定,每秒更新命令行中的数据。
什么思路请指点下?
ringa_lee2017-04-18 10:36:10
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...
巴扎黑2017-04-18 10:36:10
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'