Hello,

 

Not understanding the proper phraseology for my question I can’t search the faq so here goes:

 

I have what I think is a string from socket.recvfrom(…).  I want to turn it into numbers so I tried:

from socket import *

from array import *

 

data, address  = recvfrom (...stuff...)

s = “”

number =int(s.join(data[10:13],16)) # turn two bytes of the string into a python number, do this a lot to parse all numbers from

                                                   # socket stream

 

This yaks and says something about improper argument to int.  I don’t understand python’s type system at all so any help here will be greatly appreciated.

 

Thanks,

Frank

_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to