A small package to block print statements
Project description
HiddenPrints
Sick of unnecessary prints from other libraries? Simply block them of with this small package
Install
via pip
pip install hiddenprint
Usage
1) with-Wrapper
To use the blocking mechanisms inside of methods for one or more lines of code, just wrap it in a with-statement
from hiddenprint import *
with HiddenPrints():
# code where prints should not be visible in the console
print("This won't be printed")
# code where prints should be visible in the console
print("Hello World!")
2) Function Decorator Flag
To block prints right up for a self defined function, decorator annotations can be used to block all prints within the function.
from hiddenprint import *
@hide
def print_nothing_and_sum(a: int, b: int):
print("something nobody can see")
return a + b
result = print_nothing_and_sum(4, 3)
print(result) # prints 7
Contribution
This is only a very small package and project. If you have some ideas to improve the quality of life, feel free to make a pull request.
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
hiddenprint-0.0.2.tar.gz
(3.1 kB
view hashes)
Built Distribution
Close
Hashes for hiddenprint-0.0.2-py3-none-any.whl
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 | eaab21d6269b21405f4e2d5d96dde507b35ebd0a12f4b9a35ac88755fb9dd6a6 |
|
| MD5 | 434c04de1c549374fa50b1e48a621fe0 |
|
| BLAKE2b-256 | d2beaf698986654c113326b421bf32c0a6e4219dfb6b40402414482f9a083ff8 |