GAMR1520: Markup languages and scripting

python logo

Week 3: Practical python, some useful libraries

Back to home

This week we will be looking at two very useful python libraries. We will continue our data processing experiments by grabbing some JSON data from the web using urllib.request to make HTTP requests. We will also spend some time looking at the user interface toolkit tkinter and built a simple object-oriented GUI application.

Lectures

Lecture 3.1: Python internals

Python code is simple because python does a lot of the work for us. This lecture delves into the details, looking at what is actually happening under the hood when we write simple programmes.

Lecture 3.2: Unit testing in python

Writing tests for our code can help us to be braver about making changes. When we change our tested code, if the tests still pass then we can be confident we haven't broken anything important. If we find a bug, we can write a test to make sure the bug doesn't happen again. More than this, writing tests is a way to think about the design we want before we write any code.

Lab exercises