Skip to main content

Extended functionalities and better control over Python's built-in print function

Project description

Print Extended

Extended functionalists and better control over Python's built-in print function

PyPI version Build Status

GitHub issues GitHub closed issues GitHub closed pull requests

PyPI - Python Version GitHub GitHub last commit

Installation

> pip install print-extended

Usage

If you run Python interpreter with -O flag print will be disabled (watches for debug):

python -O

>>> import print_extended
>>> print('foo')
>>>

Runing it without -O flag works normal:

python

>>> import print_extended
>>> print('foo')
foo
>>>

Control your print with PrintControl class:

import print_extended
from print_extended import PrintControl

PrintControl.template = '--> {print} <--'
PrintControl.fg_color = 'green'
PrintControl.bg_color = 'blue'

PrintControl

Change underlying print function:

import print_extended
from pprint import pprint
from print_extended import PrintControl

PrintControl.print_function = pprint

print({...}) # will print it using pprint

Disable and enable printing

import print_extended
from print_extended import PrintControl

PrintControl.disable() # print(...) now does nothing

PrintControl.enable() # print(...) now prints

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

print_extended-0.2.0.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

print_extended-0.2.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

Supported by

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