Useful General Techniques

  • random*: for building randomisation into your code. Helpful for things like generating random numbers and/or randomised choices from data collections (e.g. lists).
  • time*: provides various time-related techniques, such as suspending execution of a script for a specified number of seconds ("sleep") or timezone information/conversions.
  • datetime*: useful for retrieving current date/time information, measuring differences between two specified time periods, and more.
  • os*: provides a way for Python to interact with your computer's operating system in various ways (e.g. to retrieve directory or file information; create, edit or delete directories and files; manage administrative privileges; etc).