Skip to Main Content
Programming in Python 3: A Complete Introduction to the Python Language, Second Edition
book

Programming in Python 3: A Complete Introduction to the Python Language, Second Edition

by Mark Summerfield
November 2009
Intermediate to advanced content levelIntermediate to advanced
648 pages
18h 41m
English
Addison-Wesley Professional
Content preview from Programming in Python 3: A Complete Introduction to the Python Language, Second Edition

5. Modules

Whereas functions allow us to parcel up pieces of code so that they can be reused throughout a program, modules provide a means of collecting sets of functions (and as we will see in the next chapter, custom data types) together so that they can be used by any number of programs. Python also has facilities for creating packages—these are sets of modules that are grouped together, usually because their modules provide related functionality or because they depend on each other.

This chapter’s first section describes the syntaxes for importing functionality from modules and packages—whether from the standard library, or from our own custom modules and packages. The section ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming in Python 3: A Complete Introduction to the Python Language

Programming in Python 3: A Complete Introduction to the Python Language

Mark Summerfield

Publisher Resources

ISBN: 9780321699909Purchase book