Neuropsydia.py
Neuropsydia.py copied to clipboard
Abort experiment
Is there any way to abort an experiment? (E.g., pressing certain keys.)
@cMadan there are currently no generic way to abort an experiment other than alt+tab and console quit. However, this can be easily added within the experiment code whenever a key press is required.
For instance:
....
n.refresh() # Diplay stimulus on screen
response, RT = n.response() # Collect the response and its time
# Categorize the response
if response == "SPACE" and stimulus == "green":
response_type = "HIT" # Hit
if response != "SPACE" and stimulus == "green":
response_type = "MISS" # Miss
if response == "ESCAPE":
quit()
Thanks! Maybe this can be added to the documentation somewhere?
I don't think alt-tab worked for me, but that may have been related to other video issues (see #21). In my case I had to ssh into my mac machine and kill the python process.
@cMadan I'm back from holidays 😄, I added an example of how to enable quitting in the stroop tutorial in docs.