Book Image

Python Essentials

By : Steven F. Lott
Book Image

Python Essentials

By: Steven F. Lott

Overview of this book

Table of Contents (22 chapters)
Python Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 12. Scripts, Modules, Packages, Libraries, and Applications

While it's easy to work with Python at the Read-Evaluate-Print Loop (REPL) >>> prompt, our real goal is to create Python application files. A Python file may be a script, which means it should be able to do some useful work when it's executed by the Python program. A file may be a module, which means that it is designed to be imported to provide useful definitions. A directory of Python modules is a package. These are formal definitions, implemented by the language.

More generic terms like library, application, or framework aren't formalized by the language. We have ways to implement these common concepts in Python. We can think of a collection of modules or packages as a library. The Python Standard Library, for example, is a large collection of modules and packages. An "application" will be at least a script. A more complex application may involve a script plus several additional modules and packages. A framework...