import pdb def main(): list = [1,2,3] pdb.set_trace() list = [2,3,4] if __name__ == '__main__': main()
现在运行使用:!python%,你会打你的断点,并能够像交互式调试在gdb。