本文整理汇总了Python中curses.reset_prog_mode方法的典型用法代码示例。如果您正苦于以下问题:Python curses.reset_prog_mode方法的具体用法?Python curses.reset_prog_mode怎么用?Python curses.reset_prog_mode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类curses
的用法示例。
在下文中一共展示了curses.reset_prog_mode方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: wrapper_fork
# 需要导入模块: import curses [as 别名]
# 或者: from curses import reset_prog_mode [as 别名]
def wrapper_fork(call_function, reset=True):
pid = os.fork()
if pid:
# Parent
os.waitpid(pid, 0)
if reset:
external_reset()
else:
locale.setlocale(locale.LC_ALL, '')
_SCREEN = curses.initscr()
try:
curses.start_color()
except:
pass
_SCREEN.keypad(1)
curses.noecho()
curses.cbreak()
curses.def_prog_mode()
curses.reset_prog_mode()
return_code = call_function(_SCREEN)
_SCREEN.keypad(0)
curses.echo()
curses.nocbreak()
curses.endwin()
sys.exit(0)
示例2: CallSubShell
# 需要导入模块: import curses [as 别名]
# 或者: from curses import reset_prog_mode [as 别名]
def CallSubShell(subshell):
"""Call this function if you need to execute an external command in a subshell (os.system). All the usual warnings apply -- the command line will be
expanded by the shell, so make sure it is safe before passing it to this function."""
curses.def_prog_mode()
#curses.endwin() # Probably causes a memory leak.
rtn = os.system("%s" % (subshell))
curses.reset_prog_mode()
if rtn is not 0: return False
else: return True
curses.reset_prog_mode()
示例3: clean_up
# 需要导入模块: import curses [as 别名]
# 或者: from curses import reset_prog_mode [as 别名]
def clean_up(self):
"""
This class overrides this method
"""
self.menu.clear_screen()
curses.reset_prog_mode()
curses.curs_set(1) # reset doesn't do this right
curses.curs_set(0)
self.menu.resume()
示例4: clean_up
# 需要导入模块: import curses [as 别名]
# 或者: from curses import reset_prog_mode [as 别名]
def clean_up(self):
"""
This class overrides this method
"""
self.submenu.join()
self.menu.clear_screen()
curses.reset_prog_mode()
curses.curs_set(1) # reset doesn't do this right
curses.curs_set(0)
self.menu.resume()