Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Key responses / logger inline script problems

edited May 2018 in OpenSesame

Hi guys,

I am posting a lot lately, I am new to python and open sesame.
BUT I MANAGE IT and the experiment is working! almost..
I am on MacBook Pro 2017
OpenSesame 3.2

I have two loops one is reading from a list of different noise levels, and one is looping in a range

for c in Noise list:
      for i in range():
              do experiment
               My_keyboard = keyboard(timeout=0)
               My_keyboard.get_key() 
log.write_vars()

Everything in the .csv is NA!! which is frustrating.

I need to find a way to log responses by index C (Noise_list) and trial i and then get key_press only left and right or everything and I can sort that out later.

Can someone help me out ??
I am assuming this is something very trivial for the people who write this things all the time.

Thanks,

Comments

  • Hi Strako,

    you assume something trivial?
    Here, some simple questions:
    1. Have you put a logger_item at the end of your experiment?
    2.1. Have you tried to put log.write_vars() into your loop? Not just when it's ended.
    2.2. I do not see that you define any variables (but maybe this is done in the experiment).
    var.i = i before log.write_vars() may help?

    Cheers
    Stephan

  • edited May 2018

    Hi DahmSF,

    Thanks for your help,
    Your suggestions solved the problem - however I don't know yet which one was more important..

    The problems were :
    1)that I have never seen any sample script with log.write_vars() in all (for) loop steps.. however it is true that is often placed after a while loop.. So I didn't know that was an option
    2) for days the code was crushing due to: 'not specified var object' .. I thought this is a bag for macs or perhaps something left on the documentation from previous versions.. so I avoided it completely.

    In any case its doing what is suppose to after your input. Cheers

    trivial-ness has no ground truth - is subjective and if not felt can be assumed I assume

Sign In or Register to comment.