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.3.tar.gz
(1.9 kB
view details)
Built Distribution
File details
Details for the file crash-ipdb-0.0.3.tar.gz
.
File metadata
- Download URL: crash-ipdb-0.0.3.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 | ae28922ecbaedffce3dfc32172227b95dec38c6943f800a6337a6c12b32e70ed |
|
MD5 | 2d07533e6416b9f9ff448c59739dceab |
|
BLAKE2b-256 | 29f1fd8c32a7aa4c47c46974bc38a8e58ac8463634a539b4863718ce856c0ee1 |
File details
Details for the file crash_ipdb-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: crash_ipdb-0.0.3-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 | 85e6f28edb82d46752a06f48da567f58b945e9dbb33d30973493267f632cfa58 |
|
MD5 | 5688e0d1dedb543ac057d546ce47fb9b |
|
BLAKE2b-256 | ad4507f93db9c561e18097e0e5f5a3d4733ee706a5805789d96dfcf91776dc43 |