本文整理汇总了Python中IPython.frontend.prefilterfrontend.PrefilterFrontEnd._on_enter方法的典型用法代码示例。如果您正苦于以下问题:Python PrefilterFrontEnd._on_enter方法的具体用法?Python PrefilterFrontEnd._on_enter怎么用?Python PrefilterFrontEnd._on_enter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPython.frontend.prefilterfrontend.PrefilterFrontEnd
的用法示例。
在下文中一共展示了PrefilterFrontEnd._on_enter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _on_enter
# 需要导入模块: from IPython.frontend.prefilterfrontend import PrefilterFrontEnd [as 别名]
# 或者: from IPython.frontend.prefilterfrontend.PrefilterFrontEnd import _on_enter [as 别名]
def _on_enter(self):
""" Called on return key down, in readline input_state.
"""
last_line_num = self.LineFromPosition(self.GetLength())
current_line_num = self.LineFromPosition(self.GetCurrentPos())
new_line_pos = (last_line_num - current_line_num)
if self.debug:
print >>sys.__stdout__, repr(self.input_buffer)
self.write('\n', refresh=False)
# Under windows scintilla seems to be doing funny
# stuff to the line returns here, but the getter for
# input_buffer filters this out.
if sys.platform == 'win32':
self.input_buffer = self.input_buffer
old_prompt_num = self.current_prompt_pos
has_executed = PrefilterFrontEnd._on_enter(self,
new_line_pos=new_line_pos)
if old_prompt_num == self.current_prompt_pos:
# No execution has happened
self.GotoPos(self.GetLineEndPosition(current_line_num + 1))
return has_executed
示例2: _on_enter
# 需要导入模块: from IPython.frontend.prefilterfrontend import PrefilterFrontEnd [as 别名]
# 或者: from IPython.frontend.prefilterfrontend.PrefilterFrontEnd import _on_enter [as 别名]
def _on_enter(self):
self.input_buffer += '\n'
PrefilterFrontEnd._on_enter(self)
示例3: _on_enter
# 需要导入模块: from IPython.frontend.prefilterfrontend import PrefilterFrontEnd [as 别名]
# 或者: from IPython.frontend.prefilterfrontend.PrefilterFrontEnd import _on_enter [as 别名]
def _on_enter(self):
""" Called on return key down, in readline input_state.
"""
if self.debug:
print >>sys.__stdout__, repr(self.input_buffer)
PrefilterFrontEnd._on_enter(self)