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
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'
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
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
print_extended-0.2.0.tar.gz
(2.8 kB
view hashes)
Built Distribution
Close
Hashes for print_extended-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7880eadc2894d46b7da4d5baefadc69e4d458845c86a7ca80dbd545d190da75e |
|
MD5 | d193a034bbd204018a11e8f890377046 |
|
BLAKE2b-256 | efc119c71b0fbf4ad786af4887ef32a489bc69e405225c68a9f24d4da5ef1cb1 |