How do I manipulate a variable whose name conflicts with PDB commands?

Use an exclamation mark ! before a statement to have it run : python -m pdb test.py > /home/user/test.py(1)<module>() -> print(‘foo’) (Pdb) !n = 77 (Pdb) !n 77 (Pdb) n foo > /home/user/test.py(2)<module>() -> print(‘bar’) (Pdb) The docs say: ! statement Execute the (one-line) statement in the context of the current stack frame. The exclamation … Read more

How to exit pdb and allow program to continue?

continue should “Continue execution, only stop when a breakpoint is encountered”, so you’ve got a breakpoint set somewhere. To remove the breakpoint (if you inserted it manually): (Pdb) break Num Type Disp Enb Where 1 breakpoint keep yes at /path/to/test.py:5 (Pdb) clear 1 Deleted breakpoint 1 (Pdb) continue Or, if you’re using pdb.set_trace(), you can … Read more

How to execute multi-line statements within Python’s own debugger (PDB)

You could do this while in pdb to launch a temporary interactive Python session with all the local variables available: (pdb) !import code; code.interact(local=vars()) Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) [GCC 4.4.3] on linux2 Type “help”, “copyright”, “credits” or “license” for more information. (InteractiveConsole) >>> When you’re done, use Ctrl-D to return to the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)