Tag Archives: modules

Get more out of Python – Modules

Following on from my post on functions in this post I am going to expand the usage by creating a module to hold the functions.  A module in the simplest form is a Python script accessible to you program.  Modules you create can either be stored in the same folder and the script you are importing into or if you include the folder you want to save them into the PYTHONPATH environment variable you can store and used them from there.  Modules can hold a lot of useful tools that you want to reuse without having to retype or copy a lot of  code.  They would normally have a set of functions that have a common purpose and the module would be names accordingly, like the string and math modules.

Continue reading