December 2000
Intermediate to advanced
816 pages
16h 57m
English
The importation of modules has some functional support from the system. We will look at those now.
The __import__() function is new as of Python 1.5, and it is the function that actually does the importing, meaning that the import statement invokes the __import__() function to do its work. The purpose of making this a function is to allow for overriding it if one is inclined to develop his or her own importation algorithm.
The syntax of __import__() is:
__import__(module_name[, globals[, locals[, fromlist]]]
The module_name variable is the name of the module to import, globals is the dictionary of current names in the global symbol table, locals is the dictionary of current names in the ...
Read now
Unlock full access