PythonDebug - mwicat/personal GitHub Wiki

In-process

PDB

from pdb import set_trace; set_trace()

Remote

Remote PDB - starts server in process

pip install remote-pdb

on server

from remote_pdb import set_trace; set_trace(port=4444)

or:

export REMOTE_PDB_PORT=4444
from remote_pdb import set_trace; set_trace()

on client

telnet 127.0.0.1 4444

PyCharm

https://www.jetbrains.com/help/pycharm/remote-debugging-with-product.html#remote-debug-config

From the main menu, choose Run| Edit Configuration.... The Run/debug configurations dialog opens. You have to click Add configuration on the toolbar, and from the list of available configurations, select Python Debug Server.

sudo pip install pydevd-pycharm~=191.7479.30
import pydevd_pycharm; pydevd_pycharm.set_trace(debug_host, port=debug_port, stdoutToServer=True, stderrToServer=True)

WinPDB

port: 51000 http://winpdb.org/docs/embedded-debugging/

sudo pip install winpdb

Server

rpdb2 -s -d -r script.py

or

import rpdb2; rpdb2.start_embedded_debugger('haslo', fAllowRemote=True, timeout=60)

Client

winpdb -olocalhost -a script.py