Class 5

From Lupyan Lab
Jump to: navigation, search


  1. Going over Exercise 4 - perceptual grouping task
    1. What's the point of this experiment anyway?
    2. Setting positions
    3. Flipping a shape
    4. Collecting and writing responses
    5. Refactoring (getting rid of redundant code), anticipating redundancy
    6. How to know if your code is as good as it can be?
  2. Using a library with custom functions
  3. Further practice working with dictionaries: iterating, printing, and sorting
    1. In class exercise 1: read in someTrialData.txt (inside commons\Exercise 4) into a dictionary using the importTrials function. Print the dictionary to outputFile.txt using the printing function from myFirstLibrary. The output file should look just like someTrialData.txt, but without the header row.
  4. In class exercise 2:
    1. Instead of generating the trial logic at run-time, write a function inside generateTrials.py that pre-generates all the trials and writes them to a file called subjCode_trials.csv, then import the function, run it, get the file, read it into a list of dictionaries, and iterate through it.

New material, if there's time

  1. Using the mouse
  2. Playing sounds
  3. Showing images
Personal tools
Namespaces
Variants
Actions
Navigation
Download and Install
Notes for each class - will be updated ~week before each class.
Programming Exercises
Projects
Quick reference
Toolbox