Pages

Sponsorship

40% off your First Order with GoDaddy.com!
Showing posts with label Django Framework. Show all posts
Showing posts with label Django Framework. Show all posts

Aug 3, 2009

Accessing the Python Help Facility from the Python Shell


Python has a ton of useful modules, and the built-in help facility is extremely useful for gaining quick access to a description of methods in a given module. Once a module is imported with import:

You can run dir(MODULE_NAME) to view the list of methods in the module:

To get help on a specific method, you can pass the module and method name to the built-in help function:

Help on class spawn in module pexpect:

This is pretty sweet, and makes coding in Python super easy.