Converting 2 bytes string into INT

Terry Reedy tjreedy at udel.edu
Fri Jul 12 11:51:19 EDT 2002


"DeDa" <deda at mypad.com> wrote in message
news:agmpj5$muevv$1 at ID-70583.news.dfncis.de...
> Hi to all, I'm a newbie of Python and I already have a big problem.
I read 2
> bytes from files and I like to convert them into an integer. How can
I do
> it?

If your two bytes form a two-digit string, such as x = '12', use
str(s).
Otherwise, you have to tell us more.

TJR






More information about the Python-list mailing list