Skip to main content

A small package to block print statements

Project description

HiddenPrints

workflow

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


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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hiddenprint-0.0.2-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file hiddenprint-0.0.2.tar.gz.

File metadata

  • Download URL: hiddenprint-0.0.2.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.10

File hashes

Hashes for hiddenprint-0.0.2.tar.gz
Algorithm Hash digest
SHA256 6823aaa6b46d8bbfe4bad84e1577df7bc672e14f40f00603f0f81b47c822d297
MD5 8d005cda730c7dfe82d0100181f82124
BLAKE2b-256 de21dc25e1b71f490e1a422f74e6805c7b3dfec244b5a89ce64c503afaa5201c

See more details on using hashes here.

File details

Details for the file hiddenprint-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: hiddenprint-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 2.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.10

File hashes

Hashes for hiddenprint-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 eaab21d6269b21405f4e2d5d96dde507b35ebd0a12f4b9a35ac88755fb9dd6a6
MD5 434c04de1c549374fa50b1e48a621fe0
BLAKE2b-256 d2beaf698986654c113326b421bf32c0a6e4219dfb6b40402414482f9a083ff8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page