Randomly select some image files from FolderA and FolderB as stimuli

OS (e.g. Win10): Win10
PsychoPy version (e.g. 1.84.x): v2020.2.10

What are you trying to achieve?:
Hi!
I am trying to run an experiment where I need to randomly select some image files from FolderA and FolderB as stimuli.

Firstly, randomly select 10 image files (e.g. image 4, 12, 33, 20, 50, 41, 37, 1, 60, 29) from FolderA, which is a larger sample, as stimuli to appear on the screen in random order, then present them again (4, 12, 33, 20, 50, 41, 37, 1, 60, 29) in the different order. This is tasks 1.

Secondly, randomly select 1 image (e.g. image 20) from the 10 (4, 12, 33, 20, 50, 41, 37, 1, 60, 29) as the target stimulus, then randomly select 4 images (e.g. image 4, 50, 33, 60) from the remainder 9 (4, 12, 33, 50, 41, 37, 1, 60, 29)and other 2 images from FolderB (6 pictures in total) around the target. All 10 images need to be presented as target in a random order, and then present them again in the different order. This is task 2.

In addition, each participant will meet the different 10 images (for example, participant1 will see image 4, 12, 33, 20, 50, 41, 37, 1, 60, 29; participant2 will see image 1, 56, 67, 44, 9, 34, 55, 90, 39, 34).

I want to know if this experimental procedure can achieve? And how can I do?
Thanks for helping! :smiley: