The Terminal is a computers most basic interface where you only can do text commands and recieve text output. On a Mac you find your Terminal by typing
Terminal into the Spotlight search.
An Terminal tutorial from a previous H&D event can be found here.
Using your keyboard
left right Navigate through command string. Hold
alt to jump over words.
up down Reuse previous commands.
enter Execute command.
ctrl c Stop and exit a running program instead of closing the window.
Running a python program
To run a python program, you first start the python interpreter and then tell it which program to run.
$ python my_program.py
It is possible, that the previous command will use python 2.7 instead of 3.x. In that case you either connect python3 to the python command to solve that permanently or you will instead have to type
$ python3 my_program.py
If you want to run a program inside a specific folder, you will first have to navigate there by typing:
$ cd [path_to_folder] $ cd ~/Desktop $ cd ~/my_folder
The tide sign
alt + n) stands for the users home directory, where
Downloads, ... are located.
If you typed in the path correctly, the next line should look like
Now you’re ready to run a program inside this folder, e.g.
my_folder$ python my_program.py