Software Requirements
Install the following software:
-
-
Avoid using the Windows Store version
-
During the installation, don’t forget to have Python added to environment variables
-
Also make sure that pip is selected as optional feature
-
-
-
Windows users: during the installation, have it install the explorer context menu additions
-
Install the VSCode Markdown Preview Mermaid extension
-
Checking Your Python Installation
It’s important to check that your Python installation works. This can be slightly tricky, since the details depend on your OS. There are two kinds of problems that can arise:
-
Python cannot be found
-
The wrong version of Python is found
Below are instructions that verify both at the same type. The goal is that you get Python to tell you which version it is, and that this version is 3.6 or higher. If you encounter problems, inform a lecturer.
Important
|
A |
Windows Instructions
In a shell, write
$ python --version
If this gives you trouble, try instead
$ py --version
MacOS Instructions
In the terminal, write
$ python --version
If this doesn’t work or prints out the wrong version, try
$ python3 --version
Linux Instructions
In the shell, write
$ python --version
If this doesn’t work or prints out the wrong version, try
$ python3 --version
Checking Your Pip Installation
Pip is Python’s package manager: it allows you to easily install now components. Check if it works by trying out the commands below:
$ pip --version
$ pip3 --version
One of these should work and should output something mentioning Python 3. If pip is not recognized, you will have to look up how to install it.
Course Related Material
Open a terminal in a directory where you wish to store your course-related files. Let’s first install the testing framework:
$ pip install git+https://github.com/ucll-scripting/testing-framework.git
Test the installation of the scripting package by executing the following command. It should show the output below (or something similar to it, as long as it’s not an error message.)
$ scripting
usage: scripting [-h] {version,test} ...
positional arguments:
{version,test} sub-command help
version returns version
test runs tests in all subdirectories
optional arguments:
-h, --help show this help message and exit
Next, you need to get access to the course material. The simplest way is cloning, but you can also choose to create your own fork. This allows you to save your work on GitHub, so that you’re sure never to lose any of it.
Cloning
In a shell, write
$ git clone https://github.com/ucll-scripting/exercises.git
Forking
-
Go to the repository’s website.
-
Create a fork (button top right).
-
You have now created a copy of the repo under your own account. The URL should look like
https://github.com/<your GitHub name>/exercises.git
. -
Clone your fork
$ git clone https://github.com/<your GitHub name>/exercises.git scripting-exercises
-
Enter the repository’s directory
$ cd scripting-exercises
-
Link it to the original repository.
$ git remote add upstream https://github.com/ucll-scripting/exercises.git
Now you can save your work using
$ git add <file>
$ git commit -m "some message"
$ git push
Concrete example:
$ cd 01-basic-python/01-arithmetic/01-five/
$ git add student.py
$ git commit -m "finished 01-five"
$ git push