Unit 7 - Modules and Files

Modules are essentially a collection of functions that you can then include in your project.

They are a means of letting you organise functions into useful groups and better structure your programs.

To date, our programs have been small enough that we have cared little for this. As our programs grow in size, structuring them into seperate files becomes essential.

No one wants to read single file of 10000 lines of code!

We will also take a look at how to read and write to files to allow our programs to load and save simple data.

In this unit we will look at:

  1. Module Basics
  2. Creating Modules
  3. Reading to Files
  4. Writing to Files
  5. Serialisation with JSON

References

W3Schools - Python Modules