It looks like you're new here. If you want to get involved, click one of these buttons!
#!/usr/bin/python
#coder : cakill schumbag
#program ilustrasikan mp3 reader
#untuk file yang memiliki TAG akan di proses
#tapi sebelumnya harus di pindah ke posisi pointer 128 byte terakhir
import sys
def main():
if len(sys.argv) < 2 :
sys.exit('gk terjadi apa-apa tuh')
else:
try:
a = open(sys.argv[1])
a.seek(-128,2)
info = ()
if a.read(3) == 'TAG':
info['title'] = a.read(30) .strip()
info['artist'] = a.read(30) .strip()
info['album'] = a.read(30) .strip()
info['year'] = a.read(4) .strip()
info['comment'] = a.read(30) .strip()
a.close()
for i in info.keys():
print'%s = %s' %(i,info[i])
else:
a.close()
sys.exit('file nya gak pake tag')
except IOError, msg:
sys.exit(msg)
if __name__ == '__main__':
main()
a = open(sys.argv[1])
a.seek(-128,2)
info = ()
if a.read(3) == 'TAG':
info['title'] = a.read(30) .strip()
info['artist'] = a.read(30) .strip()
info['album'] = a.read(30) .strip()
info['year'] = a.read(4) .strip()
info['comment'] = a.read(30) .strip()
for i in info.keys():
print'%s = %s' %(i,info[i])