Photo by Noah Näf on Unsplash
  • A logging system. Various parts of the system might need to write log messages as the system executes. These will normally need to be written out to the same file, so you will normally only want a single logger object that the whole system uses.
  • A database connection. The system might use a single database for storing all of its data, and you might need to access that database connection from many places in your code.
  • A device driver…



Photo by Dan DeAlmeida on Unsplash
  • Barrel distortion. This happens when an image appears more magnified at its centre than its edges. It is sometimes called a fisheye effect.
  • Pincushion distortion, which is the opposite of barrel distortion.
  • Perspective distortion. For example, if you take a photograph looking up at a tall building, the building will appear narrower at the top due to perspective.


Photo by Susan Q Yin on Unsplash


What are Voronoi diagrams?


Catch errors and handle them in your app.

Photo by Sigmund on Unsplash
  • Program errors.
  • What are exceptions?
  • Exceptions types.
  • Catching exceptions.
  • Using else with exceptions.
  • Using finally with exceptions.
  • Throwing exceptions.

Program errors

  • Syntax errors.
  • Logical errors.
  • Runtime errors.
s = [1, 2, 3…


Optimize list and string manipulation using slice notation.

Photo by freestocks on Unsplash
  • Specify a slice of a list.
  • Use negative indices.
  • Delete or replace a slice of a list.
  • Take a slice of a tuple or string.
  • Loop over a slice.
  • Use steps.

Slicing a list

k = [10, 20, 30, 40, 50]
print(k[1]) # 20


Photo by Aswin Anand on Unsplash
  • Controlling the colour, thickness and style (solid, dashed, dotted etc) of the lines.
  • Adding markers. A marker is a small square, diamond or other shape that marks a data point.


OSS for fun and profit

Photo by Chris Barbalis on Unsplash

Why do it?


Photo by Eugenio Mazzone on Unsplash
  • Choosing and researching the topic.
  • Writing the manuscript.
  • Making it available for sale.
  • Generating sales.

Martin McBride

Software developer. Java, Python, C++ etc. I write for pythoninformer.com and maintain the generativepy library.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store