python online help?
Thomas A. Bryan
tbryan at python.net
Fri Feb 18 23:19:20 EST 2000
More information about the Python-list mailing list
Fri Feb 18 23:19:20 EST 2000
- Previous message (by thread): python online help?
- Next message (by thread): python online help?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Benyang Tang wrote: > > Is there a online help in python? Say something like > help print > would give document of the print command. Docstrings. Not all classes/modules/methods have them, but many do. For example, >>> import string >>> print string.__doc__ Common string manipulations. Public module variables: whitespace -- a string containing all characters considered whitespace lowercase -- a string containing all characters considered lowercase letters uppercase -- a string containing all characters considered uppercase letters letters -- a string containing all characters considered letters digits -- a string containing all characters considered decimal digits hexdigits -- a string containing all characters considered hexadecimal digits octdigits -- a string containing all characters considered octal digits >>> print string.find.__doc__ find(s, sub [,start [,end]]) -> in Return the lowest index in s where substring sub is found, such that sub is contained within s[start,end]. Optional arguments start and end are interpreted as in slice notation. Return -1 on failure. >>> When you write your own code, you can include docstrings too: >>> class Foo: ... """A class docstring""" ... def bar(self): ... """A method docstring""" ... pass ... >>> print Foo.__doc__ A class docstring >>> f = Foo() >>> print f.bar.__doc__ A method docstring ---Tom
- Previous message (by thread): python online help?
- Next message (by thread): python online help?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list