what about unsigned and signed 8 bits number, 16 bits, etc??

David Fisher fishboy at SPAMredSPAMpeanutSPAM.com
Tue Jun 15 01:42:08 EDT 2004


sarmin kho <sarmin_kho at yahoo.com> writes:

> Hi Pythoners,
>  
> When it is an integer number, what is the range of the integer
> number and long integer number??
>  
> do we have typecasting of 8bits or 16bits signed and unsigned number
> in python?
>  
> the python script i m working on would need to typecast the number
> it reads from a hardware. this number would then be typecasted
> according to its type before further processing. the typecasting is
> in form of signed 8bits and 16bits number. how do i do this in
> python??

[...]

I did something like this in python once.  I read all the hardware in
unsigned bytes then fed the resulting string into a 'struct'.  Easier
for me to visualize and let the struct module workout all that byte
order cruft.

><{{{*>



More information about the Python-list mailing list