Program Development
Programming is a skill that is acquired over several years of experience with a variety of programming languages and tasks. Key high-level abilities are algorithm design and its manifestation in structured programming. Key low-level abilities include familiarity with the syntactic constructs of the language, and knowledge of a variety of diagnostic methods for trouble-shooting a program which does not exhibit the expected behavior.
This section describes the internal structure of a program module and how to organize a multi-module program. Then it describes various kinds of error that arise during program development, what you can do to fix them and, better still, to avoid them in the first place.
Structure of a Python Module
The purpose of a program module is to bring logically related
definitions and functions together in order to facilitate reuse and
abstraction. Python modules are nothing more than individual .py files. For example, if you were working
with a particular corpus format, the functions to read and write the
format could be kept together. Constants used by both formats, such as
field separators, or a EXTN =
".inf" filename extension, could be shared. If the format
was updated, you would know that only one file needed to be changed.
Similarly, a module could contain code for creating and manipulating a
particular data structure such as syntax trees, or code for performing
a particular processing task such as plotting corpus
statistics.
When you start ...