This gets the latest mp3 file in my Directory
new_file = [(os.path.getmtime(ft) , os.path.basename(ft))
for ft in os.listdir(path) if ft.lower().endswith('.mp3')]
new_file.sort()
Assigning the latest file to the file I am going to play
playFile = new_file[0][1]
Getting the Directory for the file.
PlayfileDir = os.getcwd() + '\\' + str(playFile)
Playing the file. This is where I get the error 'PlayfileDir' cannot be found.
os.system('start "PlayfileDir"')