def insert_pdb(editorWidget):
 (line, index) = editorWidget.getCursorPosition()
 indentation = get_indentation(editorWidget.text(line))
 editorWidget.insertAt(('%simport pdb; pdb.set_trace()\n' % indentation), line, 0)

def insert_pdb ( editorWidget ) : ( line , index ) = editorWidget . getCursorPosition ( ) indentation = get_indentation ( editorWidget . text ( line ) ) editorWidget . insertAt ( ( '%simport pdb; pdb.set_trace()\n' % indentation ) , line , 0 )
insert a pdb statement into the current line to debug code .