Python modules with functions

Module:

  • a file with a collection of related functions

  • needs to be imported at the top of a program, e.g.:

    import string
    import math
  • functions from a module are called using dot notation, e.g.:

    aNewName=string.replace(aName, "iet", "eter")
    logRunoff=math.log10(runoff)