示例#1
0
 def __init__(self,
              user_ns=None,
              user_global_ns=None,
              allow_close=False,
              title='Interactive Python Session',
              parent=None):
     '''
     Initialize. Redirect I/O to console.
     '''
     ConsoleView.__init__(self, title, parent)
     self.cout = StringIO()
     if allow_close:
         exit_func = self.close
     else:
         exit_func = None
     self.allow_close = allow_close
     self.interrupt = False
     IterableIPShell.__init__(self,
                              user_ns=user_ns,
                              user_global_ns=user_global_ns,
                              cout=self.cout,
                              cerr=self.cout,
                              input_func=self.raw_input,
                              exit_func=self.close)
     self.execute()
     self.cout.truncate(0)
     self.showPrompt(self.prompt)
示例#2
0
 def __init__(self, exit_func=None):
     """
     Initialize. Redirect I/O to console.
     """
     ConsoleView.__init__(self)
     self.cout = StringIO()
     IterableIPShell.__init__(self, cout=self.cout, cerr=self.cout, input_func=self.raw_input, exit_func=exit_func)
     #    self.connect('key_press_event', self.keyPress)
     self.execute()
     self.cout.truncate(0)
     self.showPrompt(self.prompt)
     self.interrupt = False
示例#3
0
 def __init__(self, exit_func=None):
     '''
     Initialize. Redirect I/O to console.
     '''
     ConsoleView.__init__(self)
     self.cout = StringIO()
     IterableIPShell.__init__(self,
                              cout=self.cout,
                              cerr=self.cout,
                              input_func=self.raw_input,
                              exit_func=exit_func)
     #    self.connect('key_press_event', self.keyPress)
     self.execute()
     self.cout.truncate(0)
     self.showPrompt(self.prompt)
     self.interrupt = False
示例#4
0
 def __init__(self, user_ns=None, user_global_ns=None, allow_close=False,
              title='Interactive Python Session', parent=None):
     '''
     Initialize. Redirect I/O to console.
     '''
     ConsoleView.__init__(self, title, parent)
     self.cout = StringIO()
     if allow_close:
         exit_func = self.close
     else:
         exit_func = None
     self.allow_close = allow_close
     self.interrupt = False
     IterableIPShell.__init__(self, user_ns=user_ns, user_global_ns=user_global_ns,
                              cout=self.cout,cerr=self.cout, 
                              input_func=self.raw_input, exit_func=self.close)
     self.execute()
     self.cout.truncate(0)
     self.showPrompt(self.prompt)