Web interface for Python's built-in PDB debugger
Web-PDB is a web-interface for Python’s built-in PDB debugger. It allows to debug Python scripts remotely in a web-browser.
Web-PDB console in Chrome browser
Install Web-PDB into your working Python environment:
pip install web-pdb
Insert the following line into your Python program at the point where you want to start debugging:
import web_pdb; web_pdb.set_trace()
The set_trace() call will suspend your program and open a web-UI at the default port 5555 (port value can be changed). Enter in your browser’s address bar: http://<your Python machine hostname or IP>:5555, for example http://monty-python:5555, and you should see the web-UI like the one on the preceding screenshot. Now you can use all PDB commands and features. Additional Current file, Globals and Locals information boxes help you better track your program runtime state.
Note: it is strongly recommended to work with the Web-PDB web-UI only in one browser session. With more than one browser window accessing the web-UI it can display incorrect data in one or more browser sessions.
Subsequent set_trace() calls can be used as hardcoded breakpoints.
Additionally, Web-PDB provides catch_post_mortem context manager that can catch unhandled exceptions raised within its scope and automatically start PDB post-mortem debugging session. For example:
import web_pdb with web_pdb.catch_post_mortem(): # Some error-prone code assert foo == bar, 'Oops!'
For more detailed info about the Web-PDB API read docstrings in the ./web_pdb/__init__.py file.
Note: Web-PDB periodically sends AJAX GET requests to /output/update endpoint. This is normal behaviour.
Web-PDB maintains one debugger instance that traces only one thread. You should not call set_trace() from different threads to avoid race conditions. Each thread needs to be debugged separately one at a time.
Each process can have its own debugger instance provided you call set_trace with a different port value for each process. This way you can debug each process in a separate browser tab/window. To simplify this you can use set_trace(port=-1) to select a random port between 32768 and 65536.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|File Name & Checksum SHA256 Checksum Help||Version||File Type||Upload Date|
|web_pdb-1.3.2-py2.py3-none-any.whl (202.1 kB) Copy SHA256 Checksum SHA256||py2.py3||Wheel||Jul 19, 2017|
|web_pdb-1.3.2-py3.6.egg (207.6 kB) Copy SHA256 Checksum SHA256||3.6||Egg||Jul 19, 2017|
|web-pdb-1.3.2.tar.gz (197.6 kB) Copy SHA256 Checksum SHA256||–||Source||Jul 19, 2017|