this just copies the __name__=='__main__' logic from pydoc.py. ?!ng can decide whether he wants to create a main() in pydoc, or rip it out of pydoc.py completely.