O'Reilly logo
  • Eihab Hala thinks this is interesting:


This chapter pulls together concepts from the earlier chapters to delve into how to create modules by example. If you follow the techniques described in this chapter, your modules will fit in with other modules and follow the import Python conventions.

A module is simply a Python source file that you choose to treat as a module. Simple as that sounds, you need to follow a few conventions when creating a module:

  • Document the module and all classes, methods, and functions in the module.

  • Test the module and include at least one test functi...