Python Language Debugging Remote debugger

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

Some times you need to debug python code which is executed by another process and and in this cases rpdb comes in handy.

rpdb is a wrapper around pdb that re-routes stdin and stdout to a socket handler. By default it opens the debugger on port 4444

Usage:

# In the Python file you want to debug.
import rpdb
rpdb.set_trace()

And then you need run this in terminal to connect to this process.

# Call in a terminal to see the output
$ nc 127.0.0.1 4444

And you will get pdb promt

> /home/usr/ook.py(3)<module>()
-> print("Hello world!")
(Pdb)


Got any Python Language Question?