Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to repeat the last command on the command-line in the python debugger, PuDB

Tags:

python

pudb

I'm on Linux and expected it to work like pdb, gdb, i.e., press enter to repeat the last command. I understand the debugger has a Variables watch window.

like image 986
auro Avatar asked Jun 09 '16 20:06

auro


People also ask

How do you repeat the last command in Python?

Alt-p retrieves previous command matching what you have typed. Alt-n retrieves next. (These are Control-p, Control-n on the Mac) Return while cursor is on a previous command retrieves that command.

How do I run Python debugger from command line?

Starting Python Debugger To start debugging within the program just insert import pdb, pdb. set_trace() commands. Run your script normally, and execution will stop where we have introduced a breakpoint. So basically we are hard coding a breakpoint on a line below where we call set_trace().

How do you continue execution in pdb?

Pressing the Enter key at the (Pdb) prompt will execute the previous command again. This is most useful after the s / n / r / unt commands to quickly step through execution line-by-line.

How do you exit debugger in Python?

The Python debugger will automatically start over when it reaches the end of your program. Whenever you want to leave the pdb console, type the command quit or exit .


1 Answers

Ctrl-n/p - browse command line history

like image 67
auro Avatar answered Oct 17 '22 08:10

auro