Changes

Jump to navigation Jump to search
282 bytes removed ,  13:03, 28 April 2015
Line 35: Line 35:     
<syntaxhighlight lang="python" line>
 
<syntaxhighlight lang="python" line>
#!/usr/bin/env python
+
def main():
 
+
    """Lots of useless code here."""
# import psychopy and rusocsci
+
    if True:
from psychopy import core, visual
+
        print "Hello, world!"
from rusocsci import buttonbox
+
        return None # Explicitly returning None!
 
+
    else:
## Setup Section
+
        raise Exception
win = visual.Window(monitor="testMonitor")
+
bb = buttonbox.Buttonbox()
+
if __name__ == "__main__":
text = visual.TextStim(win, "Press a button on the buttonbox")
+
    main()
 
  −
## Experiment Section
  −
# show text
  −
text.draw()
  −
win.flip()
  −
# wait for response
  −
b = bb.waitButtons()
  −
# show response
  −
text.setText("you pressed: {}".format(b))
  −
text.draw()
  −
win.flip()
  −
core.wait(5)
  −
 
  −
## Cleanup Section
  −
core.quit()  
   
</syntaxhighlight>
 
</syntaxhighlight>
  

Navigation menu