Skip to main content

There

Print the current filename and line.

Example, where.py

import there
import there as here

print(here)
print('and')
print(there)

Then python where.py will print:

where.py:4
and
where.py:6

replace print function

There provide a replacement for the print function, that prepend the filename and line.

Example, where.py

from there import print

print('hi')
print('there')

Then python where.py will print:

where.py:3 hi
where.py:4 there

that's it

That's it (for now), non more, no less. I have plan – the usually never get realised – to also have a there.indent that return the indentation of the current line.

Gotchas

Returns the line where the __str__, or __repr__ of there is computed. Usually by print. So it might be wrong. If you want to be sure (like when using log) wrap it in str()

Runs only on CPython likely. But anyway don't run it in production.

Release files for there 0.0.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for there 0.0.12
File Size Uploaded
there-0.0.12.tar.gz 43.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for there 0.0.12
File Interpreter ABI Platform
there-0.0.12-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 46.3 kB

Release files / there-0.0.12.tar.gz

Download URL there-0.0.12.tar.gz
Size 43.1 kB
Tags Source
SHA-256 checksum
How to use checksums
8e4bff9ba3cdb63bce1ad49c203680542ef175e64887bd895ae5ae538243f31c
BLAKE2b-256 checksum
How to use checksums
b2d2a47f6f7fce7a5db9a3517c8f839d9a9b002405c8901e9e0b3890f90e1254
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.27.1

Release files / there-0.0.12-py2.py3-none-any.whl

Download URL there-0.0.12-py2.py3-none-any.whl
Size 3.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
de8d6eaf343f48635640b7d092c13a265b955e52f85d423f410cb57bd8436afe
BLAKE2b-256 checksum
How to use checksums
d431c2aa184c8579c478e12b4b4bbfef50a209a0d03c55b23040a2820db6eeff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.27.1

Release history Release notifications | RSS feed

This release

0.0.12 This release

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

1 release file

0.0.5

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page