Howdy, Stranger!

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

Supported by

Is there a way to find out (in Python) whether an item is currently running?

Hi all,

You might think that this is pointless, because the current item will be the inline_code that we're in, but ....

I'm writing some code which uses an eyetracking API which calls a function for every new eyetracking sample. I'm trying to find a way to create s column in the output which logs the currently running OpenSesame item. How can I find out if each item is running?

Cheers,

Alisdair

Comments

  • Hi Alisdair,

    you may log the information in the logfile or you may print it in the outcome window.

    Cheers,
    Stephan

  • I indeed think it is a weird idea and I don't really get your motivation. Anyway, if you just need it for the logfile, you can simply (at least in a conceptual way) take the current time, and compare it to the start time of all items. Find the two items that were initialized right before or right after the current time and infer which item was active.

    Hope this is useful,

    Eduard

Sign In or Register to comment.