Modules
A module is a collection of Python functions (or objects) that go
together, eg a HTML parser library. To use a module you:
import moduleName
Every function from that library can now be called by:
moduleName.functionName()
Modules can include other modules, so you can do something like this:
import outerModule
outerModule.innerModule.functionName()
Standard Python comes with a huge collection of modules:
- Regular Expression library (matching, splitting, substituting, etc.)
- Mathematical functions (sin, cos, matrixes, etc.)
- Operating System Calls (esp. Posix calls)
- Networking Services (HTTP clients, servers, CGI tools)
- Multimedia Services (Image/sound viewers, manipulators)
- Object Persistence (Marshalling, Streaming)
- Parsers for SGML, XML, HTML and other DTDs
- Profiling and Debugging
- PyApache (what modperl is to Perl)
- etc.
and much more is available that isn't standard Python.
Prev
Contents
Next
Clinton Roy