Linux to Windows porting question

  • Thread starter SHELTRAW, DANIEL
  • Start date
S

SHELTRAW, DANIEL

Hello Pyhton Listees

I am trying to port some code to Windows that works fine under Linux. The offending line
is:

blk = fromstring(f_fid.read(BLOCK_LEN), num_type).byteswapped().astype(Float32).tostring()

The error I get is:

ValueError: string size must be a multiple of element size

Does anyone have an idea where the problem might be? BLOCK_LEN is specified in bytes
and num_type is Int32.

Thanks,
Daniel
 
P

Peter Otten

I am trying to port some code to Windows that works fine under Linux. The
offending line is:

blk = fromstring(f_fid.read(BLOCK_LEN),
num_type).byteswapped().astype(Float32).tostring()

The error I get is:

ValueError: string size must be a multiple of element size

Does anyone have an idea where the problem might be? BLOCK_LEN is
specified in bytes and num_type is Int32.

Is the file f_fid opened in binary mode?

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top