Need a listing of the arcpy package? Here's how to write the documentation to a file:
import arcpy
import pydoc
out_file = r'c:\home\pydev\arcpy_docs.txt'
strhelp = pydoc.plain(pydoc.render_doc(arcpy, "Help on %s"))
with open(out_file, 'w') as destination:
destination.write(strhelp)
Two things about this were not obvious to me. First, for unknown (to me, at least) reasons, writing arcpy.__doc__ to a file results in a TypeError. The call to pydoc.render_doc gets around that.
Secondly, the output contains some unsightly boldface formatting. The call to pydoc.plain removes it.
Here's another useful tip: use arcpy's Usage method to list the parameters for any tool.
print arcpy.Usage("Clip_analysis")
Get complete help information from the docstring:
print arcpy.Clip_analysis.__doc__