Friday, July 20, 2012

Python Basics

The single most important thing to know about python is that everything is object in python.

use dir() or the inspect module to inspect any object. The help() function is very useful. It's a wrapper around pydoc module.I use it frequently to know the statements like print, raise etc.

dir.__doc__ will give you the details.

inspect.getmembers() ouputs a list of all members of the passing object.

To know about any function at first try the __doc__ first

No comments:

Post a Comment

About Me

Web Developer From Dhaka, Bangladesh.