Created
May 29, 2013 15:37
-
-
Save rahul8590/5671253 to your computer and use it in GitHub Desktop.
This file contains 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
""" This Small snippet will list the set of functions present in the module | |
__doc__ | |
__file__ | |
__name__ | |
__package__ | |
information about the module. | |
Hello module used in here is a simple py file for Bottle framework. | |
""" | |
import inspect | |
# Here we are assuming the module hello has a set of functions | |
import hello as h | |
for name,data in inspect.getmembers(h): | |
if name == '__builtins__': | |
continue | |
print name , repr(data) | |
"""The output of the above code | |
will be somehting like this | |
--------------------------------------- | |
__doc__ None | |
__file__ 'hello.pyc' | |
__name__ 'hello' | |
__package__ None | |
index <function index at 0x10bc9bde8> | |
route <function route at 0x10bfa5de8> | |
run <function run at 0x10bfa6e60> | |
template <function template at 0x10bfa92a8> | |
------------------------------------------ | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment