saw in the last part of this bookimports give access to names in module' global scope that isthe module file' global scope morphs into the module object' attribute namespace when it is imported ultimatelypython' modules allow us to link individual files into larger program system more specificallymodules have at least three rolescode reuse as discussed in modules let you save code in files permanently unlike code you type at the python interactive promptwhich goes away when you exit pythoncode in module files is persistent--it can be reloaded and rerun as many times as needed just as importantlymodules are place to define namesknown as attributeswhich may be referenced by multiple external clients when used wellthis supports modular program design that groups functionality into reusable units system namespace partitioning modules are also the highest-level program organization unit in python although they are fundamentally just packages of namesthese packages are also self-contained--you can never see name in another fileunless you explicitly import that file much like the local scopes of functionsthis helps avoid name clashes across your programs in factyou can' avoid this feature--everything "livesin moduleboth the code you run and the objects you create are always implicitly enclosed in modules because of thatmodules are natural tools for grouping system components implementing shared services or data from an operational perspectivemodules are also useful for implementing components that are shared across system and hence require only single copy for instanceif you need to provide global object that' used by more than one function or fileyou can code it in module that can then be imported by many clients at least that' the abstract story--for you to truly understand the role of modules in python systemwe need to digress for moment and explore the general structure of python program python program architecture so far in this booki've sugarcoated some of the complexity in my descriptions of python programs in practiceprograms usually involve more than just one file for all but the simplest scriptsyour programs will take the form of multifile systems--as the code timing programs of the preceding illustrate even if you can get by with coding single file yourselfyou will almost certainly wind up using external files that someone else has already written modulesthe big picture