8

I am working with python and ipdb debugger. Let's say is set some breaking point in some line in a python file. Now, after running the python file, the program stops at the breakpoint. I want to be able to paste multiple lines to the ipdb shell. Now i get an error, if trying to paste mutiple lines. How can i paste mutiple lines?

Thanks.

avichoen
  • 137
  • 5
  • Possible duplicate of [How to execute multi-line statements within Python's own debugger (PDB)](http://stackoverflow.com/questions/5967241/how-to-execute-multi-line-statements-within-pythons-own-debugger-pdb) – Seanny123 Oct 07 '16 at 01:54

1 Answers1

2

As far as I know, you cannot simply paste them. You have to use ; to indicate indentation. For example:

for i in range(10): print i; print("hello")

would be equivalent to

for i in range(10): 
    print(i)
    print("hello")

If you want the hello out of the loop, then you need to use ;; instead:

for i in range(10): print i;; print("hello")
toto_tico
  • 17,977
  • 9
  • 97
  • 116