npyscreen
urwid
1,
python自带了curses库
import curses
myscreen = curses.initscr()
myscreen.border(0)
myscreen.addstr(12, 25, "Python curses in action!")
myscreen.refresh()
myscreen.getch()
curses.endwin()
#!/usr/bin/env python
from os import system
import curses
def get_param(prompt_string):
screen.clear()
screen.border(0)
screen.addstr(2, 2, prompt_string)
screen.refresh()
input = screen.getstr(10, 10, 60)
return input
def execute_cmd(cmd_string):
system("clear")
a = system(cmd_string)
print ""
if a == 0:
print "Command executed correctly"
else:
print "Command terminated with error"
raw_input("Press enter")
print ""