Skip to content

Instantly share code, notes, and snippets.

@Ryanb58
Created July 8, 2016 00:07
Show Gist options
  • Select an option

  • Save Ryanb58/63bb5240b9638e3dc93e11db20fd17a4 to your computer and use it in GitHub Desktop.

Select an option

Save Ryanb58/63bb5240b9638e3dc93e11db20fd17a4 to your computer and use it in GitHub Desktop.
Grab only the names of functions defined in a python file.
import othermodule, types
function_names = [othermodule.__dict__.get(a).__name__ for a in dir(othermodule) if isinstance(othermodule.__dict__.get(a), types.FunctionType)]
for item in items:
print "from ... import " + item
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment