How to draw from a variable in a certain way?

OS : Windows 11 Pro
PsychoPy version : 2021.2.3

Hallo, this is my first experiment I’m tring to handle. So the point ist, that I present a word and a command (draw or write).
I tried do draw randomly from an excel file where all the 80 words were listed with the draw and write conditions (160 rows in sum) with a loop (nReps: 1; selected rows: $random(26)*160).
But the words (26) should be drawn from the 80 words and they should be displayed only once regardless of the command.
And the other point is that the command draw and write both should be displayed in a 50:50 ratio.
I never scripted with python, we only learned R and I wandet to omid learning another language now. Therefore I would be realy greatful, if someone could help me.
And no worries the participants will write or draw the words with a pencil on paper, so no more advice needed :sweat_smile:

Ok, so I managed it on my own. I’ll share some info. Maybe it will help someone, who’s just as clueless as me.

With this totorial I were able to create a randomized list from which I could draw the needed amound of words.
And for the other problem, having the commands displayed in a 50:50 ratio, I created a Excel list with the amound of commands needed (13:13), randomized and drew all of them. Don’t know if it was the best way but in the end I needed one command list for the practice trial and one for the real trial, besides one word list for practice and real trial.

In the tutorial he used range() for the order in which the list should be displayed, but thats not working anymore. Instead using list(range()) worked.

greetings Klara