Is it possible to play all the .mp3's within a folder in windows media player?
I am using Python 3.2, and so far I have code that returns the absolute location of a random album in my music folder. I would like to take that string and somehow open WMP and play the music within that folder
Any suggestions?
For reference, here is my code:
import random
import os
path = ["Q:\\#User\\Music\\", "Q:\\#user\\What CDs\\"]
print("You shall play " + random.sample(list(filter(lambda f: len([i for i in f if i in "."]) == 0, sum(map(lambda d: list(map(lambda e: d + "\\" + e,os.listdir(d))),list(filter(lambda c: len([i for i in c if i in "."]) == 0, sum(map(lambda a: list(map(lambda b: a + b ,os.listdir(a))), path), [])))), []) )), 1)[0])
input()
And yes, ideally that wouldn't all be in one line. I was learning how to use map
and lambda
and thought I'd challenge myself.
I'd now like to take this one step further, and play the random album.
Thanks!