Python has a nifty feature called documentation strings which is commonly mentioned by its shorter name docstrings. We can even get back the docstring from, let say a function, when the program is actually running!
def sayHello():
”’This function prints Hello”’
print “Hello”print sayHello()
print sayHello.__doc__
Output:
Hello
This function prints Hello
To write the documentation of sys:
import pydoc
pydoc.writedoc(“sys”)
note the sys.html is written in the same path.
February 12, 2007 at 3:37 pm |
hi
watch http://www.canaravideo.com which has simmillar topic video clippings