How can I create a python script wrapper like top unix command?

I need to create a Python script shell that updates the output every n seconds, like the top unix command. what's the best way to do this?

+3
source share
1 answer

One way to do this is to write a script that prints your output (once), and then run the script using watch. The command watchwill automatically clear the screen and run the script every few seconds (usually 2 by default).

Python, curses, , VT100 -, :

print "\x1b[H\x1b[2J",
print "hello clear world"
+4

Source: https://habr.com/ru/post/1766653/


All Articles