擅长:python、mysql、java
<p>选中这个<a href="http://docs.python.org/3.3/howto/curses.html#what-is-curses" rel="nofollow">curses library</a>,curses库为基于文本的终端提供了一个独立于终端的屏幕绘制和键盘处理工具。例如:</p>
<p><strong>x.py:</strong></p>
<pre><code>from curses import wrapper
def main(stdscr):
stdscr.addstr(1, 0, 'Program is running..')
# Clear screen
stdscr.clear() # clear above line.
stdscr.addstr(1, 0, 'hello')
stdscr.addstr(2, 0, 'dude')
stdscr.addstr(3, 0, 'Press Key to exit: ')
stdscr.refresh()
stdscr.getkey()
wrapper(main)
print('bye')
</code></pre>
<p>运行它<code>python x.py</code></p>