Holcombe:Programming: Difference between revisions
Polly Barr (talk | contribs) |
Polly Barr (talk | contribs) |
||
Line 11: | Line 11: | ||
Our [[Holcombe:Psychopy| psychopy and visionegg installation notes]] . | Our [[Holcombe:Psychopy| psychopy and visionegg installation notes]] . | ||
Link to Alex's | Link to Alex's GitGub page https://github.com/alexholcombe | ||
Link to Charlie's | Link to Charlie's GitHub page https://github.com/cludowici | ||
==Python programming (outside of the Psychopy editor, as is required for VisionEgg)== | ==Python programming (outside of the Psychopy editor, as is required for VisionEgg)== |
Latest revision as of 18:23, 6 June 2017
Recent members• Alex Holcombe
|
Projects• Testing Booth Calendar |
|
Technical• Skills Checklist |
Other• Plots,Graphs
|
Psychopy
Mostly the lab uses PsychoPy. Some are still using VisionEgg. Both are libraries to help python code draw stuff.
Some nice easy programming exercises for Psychopy available from Gary Lupyan, developed for his postgrad psych class. Get your Psychopy programming questions answered at the mailing list.
If you're moving to Psychopy/Python from Matlab, SciPy has a good introduction to Python for Matlab Users, with a big list of equivalent expressions in the two languages.
Our psychopy and visionegg installation notes .
Link to Alex's GitGub page https://github.com/alexholcombe
Link to Charlie's GitHub page https://github.com/cludowici
Python programming (outside of the Psychopy editor, as is required for VisionEgg)
Running python interactively from the Terminal alone is frustrating because you can't use arrow keys for history, no auto-complete, etc. You will probably want to use some IDE.
never have your data file overwritten again! include the following lines in your python code:
from time import localtime,strftime
timeAndDateStr = strftime("%d_%b_%Y_%H:%M", localtime())
filename = 'aBindingExpData_' #include here whatever you want
filename = filename + timeAndDateStr #filename will now have date time and year tacked on the end,
outputFileStream = open(filename, 'a')
#### e.g. 'aBindingExpData_04_Aug_2008_22:46'
Also don't lose track of what program generated the data, take advantage of sys.argv which gives the invoking program name and include code something like:
import sys
print >>logF, 'running script "',sys.argv[0],'"'
Data analysis
programming in R (data analysis)
Python programming for data analysis