whole as we'll seepython fosters modular program structure that groups functionality into coherent and reusable unitsin ways that are naturaland almost automatic along the waywe'll also explore the central concepts of python modulesimportsand object attributes how to structure program at base levela python program consists of text files containing python statementswith one main top-level fileand zero or more supplemental files known as modules here' how this works the top-level ( scriptfile contains the main flow of control of your program--this is the file you run to launch your application the module files are libraries of tools used to collect components used by the top-level fileand possibly elsewhere top-level files use tools defined in module filesand modules use tools defined in other modules although they are files of code toomodule files generally don' do anything when run directlyratherthey define tools intended for use in other files file imports module to gain access to the tools it defineswhich are known as its attributes--variable names attached to objects such as functions ultimatelywe import modules and access their attributes to use their tools imports and attributes let' make this bit more concrete figure - sketches the structure of python program composed of three filesa pyb pyand py the file py is chosen to be the top-level fileit will be simple text file of statementswhich is executed from top to bottom when launched the files py and py are modulesthey are simple text files of statements as wellbut they are not usually launched directly insteadas explained previouslymodules are normally imported by other files that wish to use the tools the modules define for instancesuppose the file py in figure - defines function called spamfor external use as we learned when studying functions in part ivb py will contain python def statement to generate the functionwhich you can later run by passing zero or more values in parentheses after the function' namedef spam(text)print(text'spam'file py nowsuppose py wants to use spam to this endit might contain python statements such as the followingimport spam('gumby'file py prints "gumby spampython program architecture