当前位置: 首页>>代码示例>>Python>>正文


Python shell.PythonShellWidget类代码示例

本文整理汇总了Python中spyderlib.widgets.shell.PythonShellWidget的典型用法代码示例。如果您正苦于以下问题:Python PythonShellWidget类的具体用法?Python PythonShellWidget怎么用?Python PythonShellWidget使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了PythonShellWidget类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setup_context_menu

 def setup_context_menu(self):
     """Reimplement PythonShellWidget method"""
     PythonShellWidget.setup_context_menu(self)
     self.help_action = create_action(self, _("Help..."),
                        icon=ima.icon('DialogHelpButton'),
                        triggered=self.help)
     self.menu.addAction(self.help_action)
开发者ID:rthouvenin,项目名称:spyder,代码行数:7,代码来源:internalshell.py

示例2: setup_context_menu

 def setup_context_menu(self):
     """Reimplement PythonShellWidget method"""
     PythonShellWidget.setup_context_menu(self)
     self.help_action = create_action(self,
                        translate("InteractiveShell", "Help..."),
                        icon=get_std_icon('DialogHelpButton'),
                        triggered=self.help)
     self.menu.addAction(self.help_action)
开发者ID:Brainsciences,项目名称:luminoso,代码行数:8,代码来源:interactiveshell.py

示例3: __init__

 def __init__(self, parent, history_filename, debug=False, profile=False):
     PythonShellWidget.__init__(self, parent, history_filename,
                                debug, profile)
     # Code completion / calltips
     getcfg = lambda option: CONF.get('external_shell', option)
     case_sensitive = getcfg('autocompletion/case-sensitivity')
     show_single = getcfg('autocompletion/select-single')
     from_document = getcfg('autocompletion/from-document')
     self.setup_code_completion(case_sensitive, show_single, from_document)
开发者ID:Brainsciences,项目名称:luminoso,代码行数:9,代码来源:pythonshell.py

示例4: __init__

    def __init__(
        self,
        parent=None,
        namespace=None,
        commands=[],
        message=None,
        max_line_count=300,
        font=None,
        exitfunc=None,
        profile=False,
        multithreaded=True,
        light_background=True,
    ):
        PythonShellWidget.__init__(self, parent, get_conf_path("history_internal.py"), profile)

        self.set_light_background(light_background)
        self.multithreaded = multithreaded
        self.setMaximumBlockCount(max_line_count)

        # For compatibility with ExtPythonShellWidget
        self.is_ipykernel = False

        if font is not None:
            self.set_font(font)

        # Allow raw_input support:
        self.input_loop = None
        self.input_mode = False

        # KeyboardInterrupt support
        self.interrupted = False  # used only for not-multithreaded mode
        self.sig_keyboard_interrupt.connect(self.keyboard_interrupt)

        # Code completion / calltips
        getcfg = lambda option: CONF.get("internal_console", option)
        case_sensitive = getcfg("codecompletion/case_sensitive")
        self.set_codecompletion_case(case_sensitive)

        # keyboard events management
        self.eventqueue = []

        # Init interpreter
        self.exitfunc = exitfunc
        self.commands = commands
        self.message = message
        self.interpreter = None
        self.start_interpreter(namespace)

        # Clear status bar
        self.status.emit("")

        # Embedded shell -- requires the monitor (which installs the
        # 'open_in_spyder' function in builtins)
        if hasattr(builtins, "open_in_spyder"):
            self.go_to_error.connect(self.open_with_external_spyder)
开发者ID:dimikara,项目名称:spyder,代码行数:55,代码来源:internalshell.py

示例5: __init__

    def __init__(self, parent=None, namespace=None, commands=None, message="",
                 font=None, debug=False, exitfunc=None, profile=False):
        PythonShellWidget.__init__(self, parent,
                                   get_conf_path('.history_ic.py'),
                                   debug, profile)
        
        if font is not None:
            self.set_font(font)
        
        # Capture all interactive input/output 
        self.initial_stdout = sys.stdout
        self.initial_stderr = sys.stderr
        self.initial_stdin = sys.stdin
        self.stdout = IOHandler('<spyder_stdout>', 'w',
                                write_func=self.write,
                                flush_func=lambda: self.flush(error=False))
        self.stderr = IOHandler('<spyder_stderr>', 'w',
                                write_func=self.write_error,
                                flush_func=lambda: self.flush(error=True))
        self.stdin = IOHandler('<spyder_stdin>', 'r',
                               read_func=self.wait_input)
        self.redirect_stds()
        
        # KeyboardInterrupt support
        self.interrupted = False
        self.connect(self, SIGNAL("keyboard_interrupt()"),
                     self.keyboard_interrupt)
        
        # Code completion / calltips
        getcfg = lambda option: CONF.get('shell', option)
        case_sensitive = getcfg('autocompletion/case-sensitivity')
        show_single = getcfg('autocompletion/select-single')
        from_document = getcfg('autocompletion/from-document')
        self.setup_code_completion(case_sensitive, show_single, from_document)
        
        # keyboard events management
        self.busy = False
        self.eventqueue = []
        
        # Execution Status
        self.more = False

        # Init interpreter
        self.exitfunc = exitfunc
        self.commands = commands
        self.message = message
        self.interpreter = None
        self.start_interpreter(namespace)
        
        # Clear status bar
        self.emit(SIGNAL("status(QString)"), QString())
开发者ID:Brainsciences,项目名称:luminoso,代码行数:51,代码来源:interactiveshell.py

示例6: __init__

    def __init__(self, parent=None, namespace=None, commands=[], message="",
                 max_line_count=300, font=None, debug=False, exitfunc=None,
                 profile=False, multithreaded=True):
        PythonShellWidget.__init__(self, parent,
                                   get_conf_path('.history_internal.py'),
                                   debug, profile)
        
        self.multithreaded = multithreaded
        
        self.setMaximumBlockCount(max_line_count)
        
        if font is not None:
            self.set_font(font)
        
        # KeyboardInterrupt support
        self.interrupted = False # used only for not-multithreaded mode
        self.connect(self, SIGNAL("keyboard_interrupt()"),
                     self.keyboard_interrupt)
        
        # Code completion / calltips
        getcfg = lambda option: CONF.get('shell', option)
        case_sensitive = getcfg('codecompletion/case-sensitivity')
        show_single = getcfg('codecompletion/select-single')
        from_document = getcfg('codecompletion/from-document')
        self.setup_code_completion(case_sensitive, show_single, from_document)
        
        # keyboard events management
        self.eventqueue = []

        # Init interpreter
        self.exitfunc = exitfunc
        self.commands = commands
        self.message = message
        self.interpreter = None
        self.start_interpreter(namespace)
        
        # Clear status bar
        self.emit(SIGNAL("status(QString)"), QString())
开发者ID:cheesinglee,项目名称:spyder,代码行数:38,代码来源:internalshell.py

示例7: __init__

 def __init__(self, parent, history_filename, profile=False):
     PythonShellWidget.__init__(self, parent, history_filename, profile)
     self.path = []
开发者ID:Micseb,项目名称:spyder,代码行数:3,代码来源:pythonshell.py

示例8: flush

 def flush(self, error=False, prompt=False):
     """Reimplement ShellBaseWidget method"""
     PythonShellWidget.flush(self, error=error, prompt=prompt)
     if self.interrupted:
         self.interrupted = False
         raise KeyboardInterrupt
开发者ID:rthouvenin,项目名称:spyder,代码行数:6,代码来源:internalshell.py

示例9: __init__

 def __init__(self, parent, history_filename, debug=False, profile=False):
     PythonShellWidget.__init__(self, parent, history_filename,
                                debug, profile)
开发者ID:cheesinglee,项目名称:spyder,代码行数:3,代码来源:pythonshell.py


注:本文中的spyderlib.widgets.shell.PythonShellWidget类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。