Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/morefigs/traceprint
traceprint is a Python package that adds stack trace links to the builtin print function, so that editors such as PyCharm can link to the source of the print call.
https://github.com/morefigs/traceprint
print python stack traceback
Last synced: 3 days ago
JSON representation
traceprint is a Python package that adds stack trace links to the builtin print function, so that editors such as PyCharm can link to the source of the print call.
- Host: GitHub
- URL: https://github.com/morefigs/traceprint
- Owner: morefigs
- License: mit
- Created: 2021-03-26T05:01:26.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-19T07:01:44.000Z (9 months ago)
- Last Synced: 2024-04-30T11:18:43.236Z (8 months ago)
- Topics: print, python, stack, traceback
- Language: Python
- Homepage:
- Size: 333 KB
- Stars: 103
- Watchers: 4
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# traceprint
_"I never use the print statement for debugging, but when I do I use traceprint."_ - Guido van Rossum.
`traceprint` is a Python package that adds stack trace links to the builtin print function, so that editors such as PyCharm can link to the source of the `print` call.
![](examples/example.png?raw=true)
## Installation
[![Downloads](https://pepy.tech/badge/traceprint)](https://pepy.tech/project/traceprint)
pip install traceprint
## Usage
Simply import `traceprint` to enhance the `print` function:
```python
import traceprintprint("Hello world")
# Hello world File "/dev/traceprint/examples/example.py", line 3, in
```Some options are configurable:
```python
import traceprint
traceprint.set_options(
limit=1, # Limit depth of stack entries displayed, if limit is above zero
right_align=40, # Number of characters to offset the link text to the right by
flatten_recurring_outputs=True # Display recurring outputs (e.g. from a loop) inline instead of multiline
)
```