Trigger ipdb whenever Python crashes
Project description
crash-ipdb
Debug Python crashes conveniently: Whenever a Python code crashes, the ipdb (IPython debugger) debugger will be triggered. And the pdb commands can be used to debug your crash.
Usage
First install it with:
pip install crash-ipdb
Then import crash_ipdb
in your Python and run your code as usual (./example.py):
import crash_ipdb # just import crash_ipdb in your Python code
## simple example of source code to be debugged ##
x = 1
y = 0
print(x/y) # When you see '----> 7 print(x/y)', this will mean you have entered the ipdb, stopping at this line
You will find you have entered into ipdb and can use the pdb commands to debug your code:
Traceback (most recent call last):
File "example.py", line 7, in <module>
print(x/y) # When you see '----> 7 print(x/y)', this will mean you have entered the ipdb, stopping at this line
ZeroDivisionError: division by zero
> /home/ukp/kwang/crash-ipdb/crash-ipdb/example.py(7)<module>()
3 ## simple example of source code to be debugged ##
4 x = 1
5 y = 0
6
----> 7 print(x/y) # When you see '----> 7 print(x/y)', this will mean you have entered the ipdb, stopping at this line
Reference
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
crash-ipdb-0.0.2.tar.gz
(1.9 kB
view details)
Built Distribution
File details
Details for the file crash-ipdb-0.0.2.tar.gz
.
File metadata
- Download URL: crash-ipdb-0.0.2.tar.gz
- Upload date:
- Size: 1.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.3 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3dedec7e5a5a805e44c2d4bfb2bea8025c04cc6c2b1aa967572038c665f7725 |
|
MD5 | 87172f3c1916d83f5bce440718812f4f |
|
BLAKE2b-256 | 43d7b6a32608eb6b7e6a00ed06340ad59ad81c1f622a6e47c2692d39ef31e2ea |
File details
Details for the file crash_ipdb-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: crash_ipdb-0.0.2-py3-none-any.whl
- Upload date:
- Size: 2.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.8.3 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | afddfebb2d400958341dfc2a1cbf3f1675dd213809e532c826cb35327c4747b3 |
|
MD5 | 911830f40f10d2110933787c92f3ac4a |
|
BLAKE2b-256 | e4677e92469081dc5f6c4a745a235acfdbc5e8f732c873ee4cc6c2a567bc6ba8 |