Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# Copyright 2010 Tom Vincent <>
import os
import sys
import time
file = sys.path[0] + "/exported_tracks.txt"
with open(file) as tracks:
with open(sys.path[0] + "/mpd-formatted-tracks.txt", mode='w', encoding='utf-8') as outFile:
for line in tracks:
timestamp, track, artist, album, trackmbid, artistmbid, albummbid = line.strip("\n").split("\t")
timestamp = time.strftime("%Y-%m-%dT%H:%M:%SZ", time.localtime(int(timestamp)))
outFile.write(timestamp + " " + artist + " - " + track + "\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.