[SciPy-user] fread (from numpyio) and stderr redirection...

fred fredmfp at gmail.com
Sun Jun 10 18:32:31 EDT 2007


Hi,

I want to test that data read from file with fread has exactly the right 
dimensions.

- if less bytes are read that the required number of bytes, how can it 
be detected ?

- if more bytes are tried to read, fread returns a warning message that 
I don't want to be displayed.
How can I do this ?

I have attached a sample file that shows the three cases:

- data read from file has the right dimension: ok

- data read from file has 1 byte instead of 2: no detection error

- try to read from file 3 bytes instead of 2: warning message displayed

Any suggestion ?

Thanks in advance.


-- 
http://scipy.org/FredericPetit

-------------- next part --------------
A non-text attachment was scrubbed...
Name: essai.py
Type: text/x-python
Size: 993 bytes
Desc: not available
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20070611/22c2cf19/attachment.py>


More information about the SciPy-User mailing list