integer woes...

Richard Jones rjones at ekit-inc.com
Wed Feb 19 03:59:50 CET 2003


On Wed, 19 Feb 2003 1:50 pm, Luke McCarthy wrote:
> I have written an ID3v1 MP3 tag reader, but I have one slight problem. The
>
> track number is a two-byte integer and reads into Python like so:
> >>> tag.track
>
> '\x00\x17'
>
> (in this example, the track number is 23, which is hex 17)

>>> s='\x00\x17'
>>> ord(s[0])
0
>>> ord(s[1])
23
>>> map(ord, s)
[0, 23]



    Richard






More information about the Python-list mailing list