> Message: 4 > Date: Thu, 21 Aug 2008 12:13:58 +0200 > From: "Dotan Cohen" <[EMAIL PROTECTED]> > Subject: Re: [Tutor] Reformatting phone number > To: OmerT <[EMAIL PROTECTED]> > Cc: "python-tutor." <tutor@python.org> > Message-ID: > <[EMAIL PROTECTED]> > Content-Type: text/plain; charset=UTF-8 > > 2008/8/21 OmerT <[EMAIL PROTECTED]>: > > mostly, I google "docs.python" and the term or class I'm looking > for. > > Mind, this mainly works for modules or classes which came with the > interpreter. > > > > Exactly- that only works for term, classes, and functions that you > already know the name of. The php docs have a list of all the > functions with a one-line description. It's very easy to find which > funtion performs what one needs. > > I would have never found the startswith() function with the current > document structure. But I suppose that is subject for another thread, > which I am sure would degrade quickly into a flamewar. I don't want to > be the cause of that :)
You should also be aware of python's introspection abilities. If you have an object, you could do help(object), dir(object) to get the help file and a dictionary containing the members of the object (if run from a script, you might need to add print statement, e.g. print dir(object) ). In the case of "finding" str.startswith (i.e. a class' members), you could do this from the interactive prompt: >>> help(str) this will print the documentation of str module (and the documentation for all its children too) also, typing: >>> help() will open _interactive_ help with a prompt >>> help('modules') would list all available modules >>> help('keywords') would list all of python's reserved words >>> help('topics') would list some other topics you could pass to help() The "online"[1] help is a very powerful tool, use it often. help() and dir() can also be used from a script, although you might need to add print statement. [1] online refers to the fact that help() is generated from docstrings on-the-fly, it is not related Internet at all. PS: There is also the Internet version of the documentation _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor