I am trying to make a script that pick up a random mkv or mp4 file in a directory and play, only limit is that the file playtime must not be more than 2 hours, how do I do that? A newbee and just startet but my code looks like this:
import os
from random import choice
directory = 'D:\Johnny-3 Film 2018'
files = os.listdir(directory)
for i in range(100):
movie = choice(files)