I am writing a program that categorizes a list of Python files by which modules they import. As such I need to scan the collection of .py files ad return a list of which mod
It's actually working quite good with
print [key for key in locals().keys() if isinstance(locals()[key], type(sys)) and not key.startswith('__')]