def testName(self): songs = mp3skull.songs("mp3skull.html") # self.assertEquals( # (u"Fogo no P\u00E9 - Vai ser Comida de Bicho", "dc152.4shared.com/img/767778345/cf9db145/dlink__2Fdownload_2FU9acExuS_3Ftsid_3D20110905-125857-25868840/preview.mp3"), # songs[0]) for i in songs: print(i[0] + " >< " + i[1])
def testName(self): songs = mp3skull.songs("mp3skull.html") # self.assertEquals( # (u"Fogo no P\u00E9 - Vai ser Comida de Bicho", "dc152.4shared.com/img/767778345/cf9db145/dlink__2Fdownload_2FU9acExuS_3Ftsid_3D20110905-125857-25868840/preview.mp3"), # songs[0]) for i in songs: print (i[0] + " >< " + i[1])
''' Created on Sep 5, 2011 @author: Guga ''' import mp3skull import sys, codecs def read_file(filename): with open(filename, 'r') as f: return f.read() if __name__ == '__main__': songs = mp3skull.songs(read_file(sys.argv[1])) contents = "" for songAndLink in songs: contents = contents + songAndLink[0] + " >>> " + songAndLink[1] + "\n" print("Opening " + sys.argv[2] + " for writing") with codecs.open(sys.argv[2], 'w', encoding="UTF-8") as f: f.write(contents)
''' Created on Sep 5, 2011 @author: Guga ''' import mp3skull import sys, codecs def read_file(filename): with open(filename, 'r') as f: return f.read() if __name__ == '__main__': songs = mp3skull.songs(read_file(sys.argv[1])) contents = "" for songAndLink in songs: contents = contents + songAndLink[0] +" >>> " + songAndLink[1] + "\n" print("Opening " + sys.argv[2] + " for writing") with codecs.open(sys.argv[2], 'w', encoding="UTF-8") as f: f.write(contents)