def write_file(listSong=[],file="playlist.m3u"): f=sortie.open_file(file) for x in range(0,len(listSong)): f.write(listSong[x].path + '\n') sortie.close_file(f)
def write_file(listSong=[], file="playlist.xspf"): f = sortie.open_file(file) f.write( "<?xml version='1.0' encoding='UTF-8'?>\n<playlist version='1' xmlns='http://xspf.org/ns/0/'>\n<tracklist>" ) for x in range(0, len(listSong)): f.write("\n<track>\n<location>" + listSong[x].path + "</location>\n</track>\n") f.write("</tracklist>\n</playlist>") sortie.close_file(f)