我们从Python开源项目中,提取了以下4个代码示例,用于说明如何使用readline.GetOutputFile()。
def pre_input(self, completefn): if self.raw_input: if HAVE_READLINE: import atexit self.old_completer = readline.get_completer() # Fix Bug #3129: Limit the history size to consume less memory readline.set_history_length(self.historysize) readline.set_completer(completefn) readline.parse_and_bind(self.completekey+": complete") try: readline.read_history_file() except IOError: pass atexit.register(readline.write_history_file) self.havecolor = True if mswindows and self.enablecolor: self.cwrite = readline.GetOutputFile().write_color else: self.cwrite = self.stdout.write
def do_resizeconsole(self, line): try: import readline readline.GetOutputFile().size(width=90,height=65) except: pass