So i have the code:
import glob,os
import random
path = 'C:\Music\'
aw=[]
for infile in glob.glob( os.path.join(path,'*.mp3') ):
libr = infile.split('Downloaded',1)
aw.append(infile)
aww = -1
while 1:
aww += 1
print len(aw),aww
random.shuffle(aw)
awww = aw[aww]
os.startfile(awww)
but all it does is go through all of the songs without stopping. I thought if I could find the length of the song that is currently playing, I could use the "time" module to keep going after the song is done with the (sleep) attribute. However, I couldn't find how to get the length of the song on windows. Does anyone know a solution to my probleme?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…