Last Updated: July 09, 2018
·
8.895K
· caioariede

Python: Remote debugging with pdb

Sometimes you need to debug a code inside a thread or running in background.

rpdb is a wrapper around pdb using a tcp socket to communicate with the outside world.

pip install rpdb

In your code:

import rpdb; rpdb.Rpdb().set_trace()

Then connect through telnet to debug your code!

telnet localhost 4444

3 Responses
Add your response

You could also use rpudb (https://github.com/msbrogli/rpudb).

over 1 year ago ·

Please, see command below.

ubuntu@ip-10-0-0-312:~$ telnet 127.0.0.1 5555
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.

After that I open url which is supposed to call rpdb and I get nothing. So, how I can reach rpdb from command line then?

over 1 year ago ·