The import Statement
In the first example, the name module1 serves two different purposes—it identifies an external file to be loaded, and it becomes a variable in the script, which references the module object after the file is loaded:
>>> import module1 # Get module as a whole
>>> module1.printer('Hello world!') # Qualify to get names
Hello world!
Because import gives a name that refers to the whole module object, we must go through the module name to fetch its attributes (e.g., module1.printer).