python prints out the of instance code for all the and module properties of the object

  • 2020-05-10 18:23:01
  • OfStack

Examples are as follows:


import sys

def print_all(module_):
  modulelist = dir(module_)
  length = len(modulelist)
  for i in range(0,length,1):
    print getattr(module_,modulelist[i])

print_all(sys) 

Related articles: