def EnsureNoPrompt(self):
# Get ready to write some text NOT at a Python prompt.
self.flush()
lastLineNo = self.GetLineCount()-1
line = self.DoGetLine(lastLineNo)
if not line or line in [sys.ps1, sys.ps2]:
self.SetSel(self.GetTextLength()-len(line), self.GetTextLength())
self.ReplaceSel('')
else:
# Just add a new line.
self.write('\n')
评论列表
文章目录