December 2000
Intermediate to advanced
816 pages
16h 57m
English
Modules are a logical way to physically organize and distinguish related pieces of Python code into individual files. Modules can contain executable code, functions, classes, or any and all of the above.
When you create a Python source file, the name of the module is the same as the file except without the trailing “.py” extension. Once a module is created, you may “import” that module for use from another module using the import statement.
import module_name
Once imported, a module's attributes (functions and variables) can be accessed using the familiar dotted attribute notation:
module.function() module.variable
We will now present our Hello ...
Read now
Unlock full access