tutorial introduction the import statement creates new namespace and executes all the statements in the associated py file within that namespace to access the contents of the namespace after importsimply use the name of the module as prefixas in div divide(in the preceding example if you want to import module using different namesupply the import statement with an optional as qualifieras followsimport div as foo , foo divide( , to import specific definitions into the current namespaceuse the from statementfrom div import divide , divide( , no longer need the div prefix to load all of module' contents into the current namespaceyou can also use the followingfrom div import as with objectsthe dir(function lists the contents of module and is useful tool for interactive experimentationimport string dir(string[' _builtins_ '' _doc_ '' _file_ '' _name_ ''_idmap''_idmapl''_lower''_swapcase''_upper''atof''atof_error''atoi''atoi_error''atol''atol_error''capitalize''capwords''center''count''digits''expandtabs''find'getting help when working with pythonyou have several sources of quickly available information firstwhen python is running in interactive modeyou 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 specific module the help(command can also be used to return information about specific functions if you supply function name most python functions have documentation strings that describe their usage to print the doc stringsimply print the _doc_ attribute here' an exampleprint issubclass _doc_ issubclass(cb-bool return whether class is subclass ( derived classof class when using tuple as the second argument issubclass( (ab))is shortcut for issubclass(xaor issubclass(xbor (etc lastbut not leastmost python installations also include the command pydocwhich can be used to return documentation about python modules simply type pydoc topic at system command prompt lib fl ff