how to randomise the image shown in a sketchpad
To generate retrieve the path of a random image in a folder img_folder, it's not too difficult. You can use img_path_array = os.listdir('.../img_folder'). Randomly generate an integer between 0 and len(img_path_array) using random_index = randrange(len(img_path_array)) (import random to use this function), and gain access to the random file url by calling img_path_array[random_index].
I really appreciate any responses. I am thoroughly confused and never knew this experiment design/builder software was so complicated!
I am a fast learner, but still a newbie so please be patient.
Yes I have googled the answers for my question but no answers to similar questions seem to work.
I have an experiment, there are 8 conditions,
each condition needs to show 1 image, chosen at random from a folder of similar images.
Each trial needs to be different (so each participant sits a differently ordered set of conditions) AND each condition's selected image will be different.
So;
Condition- Image
A        - 1 to 140
B        - 1 to 80
etc..
Recording data is not a problem as this can be done by hand, but I just need the images to be randomly selected from a pre-defined group.
I have tried using code to randomise and shuffle the order, but have got nowhere.
Please help,
Tom