本文整理匯總了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)