Skip to content

Instantly share code, notes, and snippets.

@ykzts
Created February 5, 2009 09:02
Show Gist options
  • Save ykzts/58620 to your computer and use it in GitHub Desktop.
Save ykzts/58620 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import os
import sys
from glob import glob
from os import path
from random import shuffle
def main():
files = glob(path.expanduser('~/Music/iTunes/iTunes Music/*/*/*.m4a'))
shuffle(files)
for f in files:
print(f)
os.system('mplayer "{0}"'.format(f))
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment