logging name of canvas
in OpenSesame
Is there a way to access directly the name of the canvas?
I have something like:
NAME = canvas()
path = ...
NAME.image(path)
t = NAME.show()
var.Stim = NAME #also tried str(NAME)
It logs <openexp._canvas.xpyriment.Xpyriment object at 0x04E7A090>
But i would like to get NAME logged.
Comments
Hello,
I do not know it is answer your question but why not doing the inverse?
Best,
Sylvain
Hi Sylvain,
thanks for your answer but that does not help.
My stimuli are first created and put into a list. The list is shuffled. Then i present them in a sequence. I want to log the presented stimulus before each response.
Usually i made a workaround by this:
This works nicely to log the Stim as a string.
However, this gets very long if the list includes many canvas.
I thought is would be much nicer, if there would be a function that draws on the name of the canvas.
Something like:
var.Stim=canvas_name(NAME[i])@sebastiaan & @eduard: Is there something like that?
Hi,
In your first example, you're hardcoding the name of
Canvas, which isNAME. Hence, you can simply do the following:But I don't think that this is what you have in mind. What do you want to do? Perhaps you can store the
Canvasobjects in adict, where the name serves as the key?Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hey,
Or why not just having two lists, the first one with the name of the canvas, and the second with the canvas() themselves? Like:
Sylvain
I also thought about the two lists, but there was the problem with the shuffling.
Great idea to shuffle i and not the list!
Nice! Thanks!
OS Team you are the BEST!