Download the course materials using Git by entering the following command line in a Terminal:
git clone https://github.com/chrplr/PCBS.git
You should see a message
Cloning into 'PCBS'... and, if everything goes well, all the
course materials (python scripts, data files, …) should be downloaded in a new subdirectory called
PCBS, within the current working directory. You can cd into it and list its content:
cd PCBS pwd ls
Your Terminal window should more or less look like this:
If a folder named
PCBS already exists in the current working
directory, git will stop and will not download the content of the remote PCBS
repository. In that case, you must delete or move the existing
before running the
git clone command above.
When you open a Terminal, the current working directory is your “home”, or
“user”, directory, until you start navigating in the filesystem with the
(change directory) command. If you are lost at this point, read Navigating
the file system.
This tests if Python3 is installed and correctly configured.
cd ~/PCBS/games python human-guess-a-number.py
If you receive an error message such as
bash: python: No such file or directory, and you are sure that python is installed, the most likely reason is that the problems lies with the PATH environment variable) listing all the directories: the directory containing the python executable file may be missing from the list. This happens for example, if you run the Anaconda3 installer and did not check the relevant box.
matplotlib is a python library to create and display graphics.
Pygame is a Python library to create simple audio visual games.
cd ~/PCBS/stimuli/visual-illusions/ python kanizsa_triangle.py
Expyriment is a Python library for designing and conducting behavioural and neuroimaging experiments. Try to run the floowing three experiments (Note that the programs can be interrupted at any time by pressing the
cd ~/PCBS/experiments/Posner-attention python posner_task.py cd ~/PCBS/experiments/parity_decision python parity_feedback.py cd ~/PCBS/experiments/mental_logic_card_game python mental_logic_card_game.py
This should open a new window with the sublime text editor. If you get a message
command not found, ask the instructor to fix your PATH variable or try to do it by tourself 1.
Then, check out https://www.youtube.com/watch?v=SVkR1ZkNusI for a short tutorial.
The course materials are often updated. To make sure you have the latest version, you can synchronize your local copy with the github repository http://github.com/chrplr/PCBS, with the commands:
cd ~/PCBS git pull
if the PCBS directory is not in your home directory (
-), you will need to use the appropriate path in the first cd command.
do not manually modify or create new files in the
PCBSfolder. If you do so, git will notice it and might prevent an automatic upgrade and ask you to ‘resolve conflicts’. If you get such a message, the simplest course of action, for beginners, is to delete the PCBS folder (or move it if you wnat to keep a copy of your modifications) and reissue the
git clonecommand above to reload the full folder.)
For the moment, you mostly need to know the following three commands:
ls: list the content of the current working directory
pwd: path of current working directory
cd: change directory
Read about them in http://linuxcommand.sourceforge.net/lc3_lts0020.php
Here are some resources to learn more about how to control your computer from a terminal: