By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,035 Members | 1,984 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,035 IT Pros & Developers. It's quick & easy.

Linux to Windows porting question

P: n/a
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
Sep 6 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
SHELTRAW, DANIEL wrote:
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

Sep 6 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.