Skip to content

Instantly share code, notes, and snippets.

@DexterPOSH
Created February 6, 2018 05:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DexterPOSH/b8a942337372f41abfe34baefd7686fe to your computer and use it in GitHub Desktop.
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.
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