samedi 28 octobre 2017

Open files in specific and random order?

I want to open a certain .mp4 file and then open a file sceneB or sceneC.

If sceneB is selected, then I would then like it to open a random file between three choices (sceneD, sceneE, or sceneF). If sceneC is selected, I would like it to randomly open one of three choices (sceneG, sceneH, or sceneI).

Does anyone know of a link or tutorial that can help me figure this out? Am I going about this completely wrong?

Here is my code so far.

import os

#2 define scene

sceneA = "C:\Users\david\Pictures\Camera Roll\\1.mp4"
sceneB = "C:\Users\david\Pictures\Camera Roll\\2.mp4"
sceneC = "C:\Users\david\Pictures\Camera Roll\\3.mp4"
sceneD = "C:\Users\david\Pictures\Camera Roll\\4.mp4"
sceneE = "C:\Users\david\Pictures\Camera Roll\\5.mp4"

etc...

#3 choose scene order

os.startfile(sceneA)




Aucun commentaire:

Enregistrer un commentaire