December 2000
Intermediate to advanced
816 pages
16h 57m
English
It is possible to import specific module elements into your own module. By this, we really mean importing specific names from the module into the current namespace. For this purpose, we can use the from-import statement, whose syntax is:
from module import name1[, name2[, … nameN]]
Calling from-import brings the name into the current namespace, meaning that you do not use the attribute/dotted notation to access the module identifier. For example, to access a variable named var in module module that was imported with:
from module import var
we would use var by itself. There is no need to reference the module since you just imported.
It is also possible to import ...
Read now
Unlock full access