Handling data from Python socket recv -


I am using Python 2.7 socket to get data:

  data = Self.socket .recv (4096)   

How can I go about recovering unsigned less before data? The data looks like this:

  & gt; & Gt; & Gt; Print reprint (data) '\ x00 \ x053B2D4C24 \ x00 \ x00 \ x01 \ x00 ...'    

If you mean two bytes, just do this:

  data [: 2]   

If you know and a To slice the piece of data to the fixed pars, you can use the library.

Comments