Category: Article

Alphabet on blackboard

Tips for writing better Python code

I was a very experienced programmer when I started using Python. So I wrote some very bad Python code. Each language has its own way of doing things. The more you learn the language,...

Becoming a Python trainer

I’ve been ‘lucky’ enough to get a steady stream of Python training assignments. ‘Lucky’ in the sense of ‘where opportunity meets preparation’. Recently I had a long message from a fellow Python developer on...

Control your computer using Python

Python is an excellent language for taking control of your computer and performing some of the more tedious tasks. I recently used it to automate how I create Python training videos and have just...

A simple GUI (graphical user interface)

Python is an easy-to-learn yet powerful language, and comes with a wealth of libraries. It is often used to create simple scripts. You run these on the command line, giving it any parameters it...

Take out your turtle for a recursive walk

Python is a simple but powerful language, and comes with a wealth of libraries. It took just 10 lines of code and the Turtle library to create the black line in the image above....

A simple plot with Python and Bokeh

Python is a simple but powerful language, and comes with a wealth of libraries. The chart above took just 9 lines of Python. All the hard work is done by the Bokeh library. It...

Use Python to update a spreadsheet

How would you like to grab a share price daily and store it in a spreadsheet? Or add a new column to dozens of spreadsheets – automatically? Python is a simple but powerful language,...

1/2 + 1/3 = 1/6

Fractions in Python

When you ask your spreadsheet to calculate 1/2 + 1/3 you get something like this: This is obviously an approximation. The 3’s after the decimal point repeat indefinitely. The correct answer is: 1/2 =...

Sample chart

Retrieve and display a data set

(First part of the “Practical Python in 10 lines or less” series) Python is a simple but powerful language, and comes with a wealth of libraries. The chart above took just 10 lines of...