Python

Computational Thinking

What is Computational Thinking? The idea of computational thinking is allow us to look at problems and determine the best way for a computer to solve this (and related problems).

Simple Programs

Simple Programs with Python In this session we will look at writing some simple stand alone programs in Python. We will cover the following topics: #!/ __main__ sys.argv The first thing to note is that Python is an interpreted language, this means that you can run Python code directly from the command line.

Setup Python for Machine Learning and AI

Introduction In Lab1 we introduced the PyEnv tool to allow us to install various versions of python either locally or globally. In the following examples we will explore how we can setup and install specific ML libraries into a Virtual Environment using the global PyEnv python.

Databases and SQL

Databases and SQL

Command Line Arguments

Overview In this session we will look at how to pass arguments to a Python program from the command line. We will cover the following topics: sys.argv argparse click What are command line arguments?

Type Hinting

Type Hints were added to python 3.5 as a way of adding support for linters and 3rd party tools to check code for possible errors. These have no effect of the running of the code and are not mandatory, however they are good software engineering practice and we encourage their use throughout your code.

Type Hints

Aims We will investigate some modern python features and concepts by developing some small programs. Type Hinting Type hints were added to python 3.5 as a way of adding support for linters and 3rd party tools to check code for possible errors.

File IO

Overview In this session we will look at how to read and write files in Python. We will cover the following topics: Opening and closing files Reading and writing text files context managers We will also continue to develop our csv writer program from the previous session.

Lab 4 An Image Class

Aims The aim of this lab is to continue our exploration of TDD in python by developing an Image Class Configure GitHub for labs. Developing a Simple Image Class Understand and Use python packages and uv Develop some simple Image algorithms.

Type Hints

Aims We will investigate some modern python features and concepts by developing some small programs. Type Hinting Type hints were added to python 3.5 as a way of adding support for linters and 3rd party tools to check code for possible errors.