Modules
Please read the following:
- Think Python, Section 14.9 – Writing Modules
- Working with Modules in Python
- Modules Tutorial – don’t read 6.4 on Packages
All of these readings describe ways to break up a python program into multiple different source files, called “Modules”, instead of putting all of the code into a single python file. Breaking up programs into multiple modules is important for scale – as your programs get bigger and better, putting it all in one file gets complicated quickly.
Think about the programming work that you’ve done so far, and what you might do in the future. How many files will you use? What goes in each file? We usually try to put related code in files together – so all the code that does drawing might go in one file, and all the code that accesses twitter might go in another file, and so on. In your summary for this week, think about and try to come up with a strategy for deciding when to break up a program into multiple files, and how to decide what goes in what file.
Then, write down a question. It can be a point of confusion or a needed clarification about anything in the readings, or it can be something interesting that you thought about while you were reading that goes beyond the reading. Or it can be an example you thought about, or a connection you made between the concepts here and other parts of your life. But write down a good question or example based on what you were thinking about while reading.
The summary + question for this week can be submitted on Canvas.