Problem creating a variable using inline script
Hi !
I am trying to develop task for my PhD research. Following is the description of the task:
Time course of the stimulus presentation in the letter delayed match-to-sample task. A black “+” symbol is displayed at the center of the screen for 500 ms as a reminder to the participants to pay attention. Subsequently, a blank screen is displayed for approximately 600 ms before a letter loop appears. In a clock-like loop, 4–10 upper case letters are displayed in a random order for 1,500 ms each. After the letter loop disappears, the screen remains blank for 1,300–1,800 ms before a lowercase letter appears at the center of the screen for a further 1,500 ms. Participants must determine whether this letter was among the letters in the clock-like loop (irrespective of case). Subsequently, another blank screen is displayed for 1,000 ms, after which the task ends
I'd like to display a random strings of uppercase alphabets which range from 4-10. For this I've written the following code.
variable1 = lambda: random.choice(string.ascii_uppercase) # randomly generating letters
letter = print(variable1()) # assigning the value of variable1 to an experimental variable 'letter'
exp.variable = 'letter' #making the variable 'letter' available elsewhere in my experiment
I am getting the following error while starting the experiment
Can someone please help me solve this
Thanks
Vatsal.
Comments
Hi Vatsal,
You can find a starting point for your problem in this other discussion, in which I responded to you:
http://forum.cogsci.nl/index.php?p=/discussion/3163/suggestion-regarding-an-inline-script#latest
However, I also recommend you check out some python and Opensesame tutorials. It is quite evident from the little snippet you provide up there that you don't really know how to patch your experiment together. So on the long-run you would benefit massively (both time- and flexibility-wise) if you first invest some time into understanding the basics of programming.
Here links to some tutorials:
General Opensesame
General Opensesame II
Advanced Opensesame with Inline coding
Python I
Python II
Good luck,
Eduard
Hey !
Thanks for responding. I'll be discussing the issue in this post.
Thanks a lot
Vatsal