#!/usr/bin/python import sys import os if len(sys.argv) < 1: print 'Es muss ein Pfad angegeben werden!' sys.exit(); path = sys.argv[1]; playlist = ''; for file in os.listdir(path): if file.endswith(".mp3"): playlist = playlist + file + '\r\n'; datei = open(path + 'playlist.m3u', 'w'); datei.writelines(playlist); print 'Playlist erfolgreich erstellt!';