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

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

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

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

Uploaded Python 3

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.0

2 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