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.

Filename, size & hash SHA256 hash help File type Python version Upload date
pp_ez-0.2.0-py2.py3-none-any.whl (3.3 kB) Copy SHA256 hash SHA256 Wheel 2.7
pp-ez-0.2.0.tar.gz (2.0 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page