Re: issue with struct.unpack

2012-08-28 Thread 9bizy
On Wednesday, 29 August 2012 00:36:40 UTC+1, MRAB wrote: > On 29/08/2012 00:01, 9bizy wrote:> On Tuesday, 28 August 2012 23:49:54 > > UTC+1, MRAB wrote: > > >> On 28/08/2012 23:34, 9bizy wrote: > > >> > This is what I have to reproduce the challenge I am having below: > > >> > > > >> >

Re: issue with struct.unpack

2012-08-28 Thread MRAB
On 29/08/2012 00:01, 9bizy wrote:> On Tuesday, 28 August 2012 23:49:54 UTC+1, MRAB wrote: >> On 28/08/2012 23:34, 9bizy wrote: >> > This is what I have to reproduce the challenge I am having below: >> > >> > import csv >> > import struct >> > >> > data = [] >> > >> > for Node in csv.reader(file(

Re: issue with struct.unpack

2012-08-28 Thread 9bizy
On Tuesday, 28 August 2012 23:49:54 UTC+1, MRAB wrote: > On 28/08/2012 23:34, 9bizy wrote: > > > This is what I have to reproduce the challenge I am having below: > > > > > > > > > import csv > > > import struct > > > > > > > > > data = [] > > > > > > for Node in csv.reader(file('s_data.

Re: issue with struct.unpack

2012-08-28 Thread MRAB
On 28/08/2012 23:34, 9bizy wrote: This is what I have to reproduce the challenge I am having below: import csv import struct data = [] for Node in csv.reader(file('s_data.xls')): That tries to read the file as CSV, but, judging from the extension, it's in Excel's format. You don't even use

Re: issue with struct.unpack

2012-08-28 Thread MRAB
On 28/08/2012 23:35, 9bizy wrote: On Saturday, 25 August 2012 20:16:54 UTC+1, MRAB wrote: On 25/08/2012 19:34, 9bizy wrote: > I am trying to unpack values from sensor data I am retrieving through > a serial cable, but I get errors while using struct.unpack, how can I > use struct.unpack to u

Re: issue with struct.unpack

2012-08-28 Thread 9bizy
On Saturday, 25 August 2012 20:16:54 UTC+1, MRAB wrote: > On 25/08/2012 19:34, 9bizy wrote: > > > I am trying to unpack values from sensor data I am retrieving through > > > a serial cable, but I get errors while using struct.unpack, how can I > > > use struct.unpack to unload the data in a rea

Re: issue with struct.unpack

2012-08-28 Thread 9bizy
This is what I have to reproduce the challenge I am having below: import csv import struct data = [] for Node in csv.reader(file('s_data.xls')): data.append(list((file('s_data.xls' data = struct.unpack('!B4HH', data) print "s_data.csv: ", data I tries so many format

Re: issue with struct.unpack

2012-08-26 Thread Alexander Blinne
On 26.08.2012 01:31, Dennis Lee Bieber wrote: > The struct module relies upon the user knowing the format of the data. > If your problem is that you have some null-terminated string data in a > variable width field, you will have to locate the position of the null > FIRST, and specify the appropria

Re: issue with struct.unpack

2012-08-25 Thread MRAB
On 25/08/2012 19:34, 9bizy wrote: I am trying to unpack values from sensor data I am retrieving through a serial cable, but I get errors while using struct.unpack, how can I use struct.unpack to unload the data in a readable format? I checked the python documentation for struct and I can seen to

Re: issue with struct.unpack

2012-08-25 Thread Mark Lawrence
On 25/08/2012 19:34, 9bizy wrote: I am trying to unpack values from sensor data I am retrieving through a serial cable, but I get errors while using struct.unpack, how can I use struct.unpack to unload the data in a readable format? I checked the python documentation for struct and I can seen

issue with struct.unpack

2012-08-25 Thread 9bizy
I am trying to unpack values from sensor data I am retrieving through a serial cable, but I get errors while using struct.unpack, how can I use struct.unpack to unload the data in a readable format? I checked the python documentation for struct and I can seen to find any argument for this. I h