Created
February 6, 2018 05:28
-
-
Save DexterPOSH/b8a942337372f41abfe34baefd7686fe to your computer and use it in GitHub Desktop.
Basic FormatList function, it helps me seeing the attributes on a Python object.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def FormatList(object, width=100): | |
keys = [i for i in dir(object) if ( not str(i).startswith('__'))] | |
if keys: | |
for key in keys: | |
print("{0:<40} : {1:<80}".format(key, (str(getattr(object, key)))[:width])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment