O'Reilly logo

Python: Essential Reference, Third Edition by David Beazley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Getting Help

When working with Python, you have several sources of quickly available information. First, when Python is running in interactive mode, you can use the help() command to get information about built-in modules and other aspects of Python. Simply type help() by itself for general information or help(‘modulename’) for information about a specific module. The help() command can also be used to return information about specific functions if you supply a function name.

Most Python functions have documentation strings that describe their usage. To print the doc string, simply print the __doc__ attribute. Here’s an example:

						>>> print issubclass.__doc__ issubclass(C, B) -> bool Return whether class C is a subclass (i.e., a derived class) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required