469,327 Members | 1,226 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,327 developers. It's quick & easy.

Linux to Windows porting question

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
1 1553
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.

Similar topics

15 posts views Thread by windozbloz | last post: by
6 posts views Thread by Raghavendra | last post: by
1 post views Thread by Sunanda | last post: by
7 posts views Thread by Lior | last post: by
4 posts views Thread by Hitchkas | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by listenups61195 | last post: by
reply views Thread by Purva khokhar | last post: by
reply views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.