Created
July 8, 2016 00:07
-
-
Save Ryanb58/63bb5240b9638e3dc93e11db20fd17a4 to your computer and use it in GitHub Desktop.
Grab only the names of functions defined in a python file.
This file contains hidden or 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
| 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