本文整理汇总了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)
示例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)
示例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)
示例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)
示例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())
示例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())
示例7: __init__
def __init__(self, parent, history_filename, profile=False):
PythonShellWidget.__init__(self, parent, history_filename, profile)
self.path = []
示例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
示例9: __init__
def __init__(self, parent, history_filename, debug=False, profile=False):
PythonShellWidget.__init__(self, parent, history_filename,
debug, profile)