How to play movies one after the other using a loop and movieStim

Hi all, I’m using the Psychopy coder to try and present 4 videos in a random order, one after the other. So far I’ve been following along with the MovieStim demo and can play my first video, but can’t work out how to play all the videos one after the other in the loop. Any guidance would be really appreciated. I’ve only just stepped into the world of coding.

Here is my code:

from psychopy import visual, core, event, constants
import random

win = visual.Window((800, 600), fullscr=False)

#Loading in the movies files...
my_movies = ['video_01.mov', 'video_02.mov', 'video_03.mov', 'video_04.mov' ]#path to your movies from this directory
random.shuffle(my_movies)

#Create a new movie stimulus instance
for movie in my_movies:
    mov = visual.MovieStim(win, movie,
    size=600,  # set as `None` to use the native video size
    pos=[0, 0],  # pos specifies the /center/ of the movie stim location
    flipVert=False,  # flip the video picture vertically
    flipHoriz=False,  # flip the video picture horizontally
    loop=False,  # replay the video when it reaches the end
    autoStart=True)  # start the video automatically when first drawn

while mov.status != constants.FINISHED:
    # draw the movie
    mov.draw()
    # flip buffers so they appear on the window
    win.flip()

# stop the movie
mov.stop()

# clean up and exit
win.close()
core.quit()

Solved it.

Just had to change my loop:

for movie in mov:
    while movie.status != constants.FINISHED:
        movie.draw()
        win.flip()