Changes
Jump to navigation
Jump to search
← Older edit
Newer edit →
Meta:Samples/Software
(view source)
Revision as of 13:03, 28 April 2015
282 bytes removed
,
13:03, 28 April 2015
→Template
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>
E.vandenberge
Bureaucrats
,
Administrators
1,344
edits
Navigation menu
Personal tools
Log in
Namespaces
Project page
Discussion
Variants
Views
Read
View source
View history
More
Search
Navigation
Main page
Help
About
About the TSG
About this Wiki
FAQ
Disclaimer
Survey
Customer Survey
Tools
Special pages
Printable version