A cool python package to add the line number and file name in the print statements.
Project description
Print Position
A cool python package to add the file name and line number in the print statements. This small tool can be very helpful in debugging big Python projects.
Motivation
To debug the Python code present in multiple files, it becomes difficult to track down the print statement calls in the different files. This small pip package can be highly useful in such cases, one can simply use the custom print statement defined in this package and see the filename and line number of the print call.
How to install?
Just install the package using the command:
pip3 install print_position
Usage
Simply add this import statement on top of your python file to see the file name and line number of each print statement.
from printPosition.printPosition import printPosition as print
A simple example is (test.py):
from printPosition.printPosition import printPosition as print
print("Test on line 2 from test.py")
print("Test on line 3 from test.py")
print("Test on line 7 from test.py")
The output is shown as:
@file_name:line_number
print_data
I believe this would be very helpful in tracking down errors during debugging, especially when you are working with someone else's code.
Contact me
To raise any issues/requests you may refer the issue page here.
You may mail me here on my mail id.
Feel free to connect with me on my LinkedIn.
Please do check out my other projects on my GitHub here.
Also I have made many cool Firefox Add ons. They are pretty useful, you may want to check them out here.
If you like my work, you may want to buy me a book here.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file print_position-1.0.0.tar.gz
.
File metadata
- Download URL: print_position-1.0.0.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f5780c76586d86b26707f0a2c09c0c9d7d2baf64a6487d5c1d0291afd7cecc6 |
|
MD5 | 9aad13c2385d1befc98770d2615bfa8e |
|
BLAKE2b-256 | feb4c43579a5183a47cbfea450a2519a8f15c4322ba958e2115727d732c052dd |
File details
Details for the file print_position-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: print_position-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1151ff06cd642378f770195062e06cdaf09af2406ec4c21314167127af79d46d |
|
MD5 | 2776543585be471a7caa2558f2f98184 |
|
BLAKE2b-256 | 43157a1c71af39104df6608b079d79b5a219bbada58136940482129be48925b2 |