Python-printr is a Python module that allows you to emulate PHP's print_r() function by printing the internal structure and objects properties of a class instance.
Example:
# -*- coding: utf-8 -*-
class Vidrio(object):
def __init__(self):
self.color = ''
class Marco(object):
def __init__(self):
self.color = ''
self.material = ''
self.vidrio = Vidrio()
class Ventana(object):
def __init__(self):
self.posicion = ''
self.marco = Marco()
from printr import printr
ventana = Ventana()
printr(ventana)
Returns:
< Ventana object >
{
posicion: ''
marco: < Marco object >
{
color: ''
vidrio: < Vidrio object >
{
color: ''
}
material: ''
}
}
Product's homepage
Requirements:
· Python