This is a course to learn the Python programming language.
You need to bring your own laptop with either Windows (at least Windows 10), or MacOS, or Linux.
To prepapre for the course, install the following on your laptop:
-
Download this course-repository to your laptop. For example you can download its zip here.
-
Install Python 3.x from https://www.python.org/ , at least version 3.9. The latest now is 3.10.
To check if you have the right version, open a Command Line Interface (CLI) (also called 'Command Prompt' in Windows). In Mac a CLI looks like this:
In the CLI, type one of these commands:
python3 --version
python --version
Check if you also get
pip3
, which is Python's official package manager; you need this for installing packages which are not in the standard Python distributions (for example data-science related packages). To check if you have pip3, do this in your CLI:pip3 --version
-
Install the package
pandas
for Python. From CLI do one of these:pip3 install pandas
python3 -m pip install pandas
-
Test your Python installation. At CLI, go to root directory of this course materials. Then run the program
testme.py
from the CLI:python3 testme.py
The program should not crash.
-
Install Visual Studio Code (VSC) from https://code.visualstudio.com/ ; we will use this later as a text editor to write programs.
From VSC, install the Python Extensions. This shoukd also intsall Jupyter extension. If Jupyter extension is installed, you can just do
Open Folder
from VSC to open the directoryLecturenotes
of this course. After this you can browse the lecture notes from VSC. -
Install Jupyter. This gives you an easy to use working environment to do our exercises at the beginning.
After you installed Python 3.x (above), you can install
Jupyter Notebook
from Python 3.x. From CLI, do these:pip3 install --upgrade pip
pip3 install jupyter
After installing Jupyter, to try that it works, from CLI, go to the directory where you unziped this course, and do:
jupyter notebook
This should open Jupyter in your web-browser. From there, browse the course materials, load one of the
*.ipynb
files in the folderLecturenotes
.You can use either this web-browser-based Jupyter. Alternatively, use VSC to open and browse the folder
Lecturenotes
. From there just open one of the*.ipynb
files in the folder, this will open the file in the Jupyter-mode in VSC.
- Lecture notes and exercises (previously in PDF format, now as interactive Jupyter notebooks)
- Project assignments (for four two-week projects, done in groups of 3-4 students)
This work is licensed under a Creative Commons Attribution 4.0 International License.
This course is based on the materials from the course Computational Thinking, Programming with Python and Programming with Data at Utrecht University (CoTaPP), developed by Anna-Lena Lamprecht and Amy van der Ham. Thank you!