diff --git a/README.md b/README.md index 930d9a2..5b38592 100644 --- a/README.md +++ b/README.md @@ -4,23 +4,23 @@ --- - - + + **var\_dump** is a PHP's `var_dump()` equivalent function for python. It displays structured information such as type, value etc of a python `object`, `list`, `tuple`, `dict` & other types. ### Installation ### ----------- -using `pip` - - pip install var_dump - -Or - -clone the project & cd into the `python-var_dump` directory -then run: - - python setup.py install +---------- +using `pip` + + pip install var_dump + +Or + +clone the project & cd into the `python-var_dump` directory +then run: + + python setup.py install ### Examples ### ---- #### Example #1: #### @@ -45,34 +45,41 @@ you can pass more than one argument: #2 NoneType(None) #3 bool(False) -#### Example #3: #### +#### Example #3: #### - from var_dump import var_dump +```python +from var_dump import var_dump - class Base(object): - - def __init__(self): - self.baseProp = (33, 44) - self.fl = 44.33 - class Bar(object): - - def __init__(self): - self.barProp = "I'm from Bar class" - self.boo = True - - - class Foo(Base): - - def __init__(self): - super(Foo, self).__init__() - self.someList = ['foo', 'goo'] - self.someTuple = (33, (23, 44), 55) - self.anOb = Bar() - self.no = None - - foo = Foo() - var_dump(foo) +class Base(object): + + def __init__(self): + self.baseProp = (33, 44) + self.fl = 44.33 + + +class Bar(object): + + def __init__(self): + self.barProp = "I'm from Bar class" + self.boo = True + + +class Foo(Base): + + def __init__(self): + super(Foo, self).__init__() + self.someList = ['foo', 'goo'] + self.someTuple = (33, (23, 44), 55) + self.anOb = Bar() + self.no = None + + +foo = Foo() +# var_dump(foo) +print(foo) + +``` #### Output #### #0 object(Foo) (6)