Skip to main content

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

Metadata

Release files for print-extended 0.2.0

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

Source distribution (sdist)

Source distribution for print-extended 0.2.0
File Size Uploaded
print_extended-0.2.0.tar.gz 2.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for print-extended 0.2.0
File Interpreter ABI Platform
print_extended-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.9 kB

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

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