KUJUNTI.ID MINISH3LL
Path : /usr/share/doc/python3-rich/examples/
(S)h3ll Cr3at0r :
F!le Upl0ad :

B-Con CMD Config cPanel C-Rdp D-Log Info Jump Mass Ransom Symlink vHost Zone-H

Current File : //usr/share/doc/python3-rich/examples/repr.py


import rich.repr


@rich.repr.auto
class Bird:
    def __init__(self, name, eats=None, fly=True, extinct=False):
        self.name = name
        self.eats = list(eats) if eats else []
        self.fly = fly
        self.extinct = extinct


# Note that the repr is still generated without Rich
# Try commenting out the following line

from rich import print

BIRDS = {
    "gull": Bird("gull", eats=["fish", "chips", "ice cream", "sausage rolls"]),
    "penguin": Bird("penguin", eats=["fish"], fly=False),
    "dodo": Bird("dodo", eats=["fruit"], fly=False, extinct=True),
}
print(BIRDS)

© KUJUNTI.ID