Skip to main content

A short alias for the pprintpp or pprint module

Project description

pp can be installed with Python 2 or Python 3 using pip or easy_install:

$ pip install pprintpp pp-ez
- OR -
$ easy_install pprintpp pp-ez

The pp package is just an alias for the pprintpp package (and falls back to the pprint package if pprintpp isn’t available), plus a bit of magic so it can be called directly:

>>> import pp
>>> pp(["Hello", "world"])
["Hello", "world"]
>>> pp.fmt([1, 2, 3])
'[1, 2, 3]'
>>> pp.pprint([1, 2, 3])
[1, 2, 3]
>>> pp.pformat([1, 2, 3])
'[1, 2, 3]'

By default, pp tries to use the pprintpp package, but if that is not available it will fall back to using pprint:

>>> import pp
>>> pp
<module 'pp' (pp_magic_module with pprint_mod='pprint')>
>>> pp.pprint_mod
<module 'pprint' from '.../lib/python2.7/pprint.pyc'>

See also: pprint++:

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pp-ez, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size pp_ez-0.2.0-py2.py3-none-any.whl (3.3 kB) File type Wheel Python version 2.7 Upload date Hashes View
Filename, size pp-ez-0.2.0.tar.gz (2.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page