A module is a Python file whose functions can be imported and reused by other programs. Any .py file can serve as a module, even when it began as a standalone program. section 14.3.3 section 14.5
Importing a function
A rhymer.py file can expose stemmer() for interactive testing: import it with `from rhymer import stemmer`, then call `stemmer('banana')`. Alternatively, use the qualified name `rhymer.stemmer('cake')`. section 14.3.3
Use modules to keep reusable code separate from program execution:
- Guard command-line startup with `if __name__ == '__main__': main()`, so importing the module does not run main(). section 14.3.3
- Prefer small, tested functions in shared modules over copying code between programs; one fix can then benefit every user. section 14.3.3 section 14.5


































