Holcombe:Programming

From OpenWetWare

(Difference between revisions)
Jump to: navigation, search
(Tricks)
Line 5: Line 5:
Our [[Holcombe:Psychopy| psychopy notes]].
Our [[Holcombe:Psychopy| psychopy notes]].
 +
 +
==Installing Visionegg and Psychopy==
 +
Here is a file [[Media:Matlab-python-xref.pdf‎]] that gives equivalent code for doing array operations in MATLAB, Python, and R
 +
==Python programming==
==Python programming==

Revision as of 06:44, 30 October 2008

Members

Alex Holcombe
Sarah McIntyre
Fahed Jbarah
• Shih-Yu Lo
• Patrick Goodbourn
Lizzy Nguyen
Alumni


Technical

Skills Checklist
Python Programming
Psychopy/VisionEgg Installation Notes
R analysis,plot,stats
Statistics
Buttonbox
Verifying timing
Programming Cheat Sheets


To understand Dani's programs, there are two steps. First, you must learn Spanish.

Mostly the lab uses VisionEgg (also see mailing list and PsychoPy python libraries to help draw stuff.

Our psychopy notes.

Installing Visionegg and Psychopy

Here is a file Media:Matlab-python-xref.pdf‎ that gives equivalent code for doing array operations in MATLAB, Python, and R


Python programming

Here is a file Media:Matlab-python-xref.pdf‎ that gives equivalent code for doing array operations in MATLAB, Python, and R

Good syntax guide here , Explanation of how default assignment creates reference rather than new variable here says to use deepcopy()

Here Media:AudioAndUSBnotesWithPython.oo3 is the file with all my notes on different ways to play a sound in Python and the associated latencies and standard deviations of the latencies--Alex O. Holcombe 05:15, 25 June 2008 (UTC)

Dr. Python is good because it checks indentation. Instead of using {} to delimit code blocks, it uses indentation like so: if X

 asdf
 asdf

dddd ---Each line needs to be offset by the same number of spaces/tabs. Dr. Python checks to make sure this is true so you're not tripped up by invisible characters like tabs masquerading as spaces

if X

 asdf
 asdf

Tricks

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'


programming in R (data analysis)
Views
Personal tools