integer woes...

Paul Rubin http
Tue Feb 18 21:58:42 EST 2003


"Luke McCarthy" <luke at ukonline.co.uk> writes:
> >>> tag.track
> '\x00\x17'
> 
> (in this example, the track number is 23, which is hex 17)
> 
> My dilemma: how can I convert this into an integer?

See the struct module.

> Whoever designed these tags must be weird. Why was the track number a short
> int yet the year a string??? Why make artist, title and album 30 chars long
> yet make the comment 28 chars long???

It's really pretty silly, trying to save a few bytes in a file that is
typicall megabytes.




More information about the Python-list mailing list