Skip to main content

Python-printr (or PyPrintr) is a recursive printing objects module that allows to emulate the print_r() function of PHP by printing the objects properties of a class instance and its internal structure.

NOTICE: If you need to use printr() function for list, tuples and dicts, please, don’t use printr() function. You can choose pprint module. printr() function is only for objects of your own class instances. Read more about Python-printr at https://pypi.python.org/pypi/pyprintr

Developed by:

Eugenia Bahit http://www.eugeniabahit.com/

Contributors:

Alejandro Ramirez http://www.ramirezalejandro.com.ar/

Licence:

GPL v3.0

Basic Usage

First, you must get an object of a class instance and then, you can call to the printr function by passing the object like an argument function.

from printr import printr

my_object = MyClass()
printr(my_object)

Customization

Change this value by modifying the IDENTATION_CHAR constant:

import printr
printr.IDENTATION_CHAR = "."  # use point to identation
myobject = MyClass()
printr.printr(myobject)

Also, you can set the identation width, by modifying the TAB_WIDTH constant (by default is 4):

import printr
printr.TAB_WIDTH = 2
myobject = MyClass()
printr.printr(myobject)

Metadata

Release files for pyprintr 1.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 pyprintr 1.0
File Size Uploaded
pyprintr-1.0.tar.gz 14.9 kB Details

Release files / pyprintr-1.0.tar.gz

Download URL pyprintr-1.0.tar.gz
Size 14.9 kB
Tags Source
SHA-256 checksum
How to use checksums
05cc6089c50431f0d110ffe7d8338299be87fc29d0b24b558ef4b400c18b63ff
BLAKE2b-256 checksum
How to use checksums
6cdfabcbb0a84de32dd19a9dd788c456d507a774a294aa7a2292f74708a24c1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0 This release

1 release file

0.3

1 release file

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