Re: fromfile error on windows, not mac

2008-07-23 Thread Tommy Nordgren
One question : Did you remember to open the file in binary mode? This MUST be done on windows. On 22 jul 2008, at 06.36, jadamwil wrote: Hello, I am using the numpy fromfile function to read binary data from a file on disk. The problem is that the program runs fine on a Mac, but gives an error

Re: fromfile error on windows, not mac

2008-07-23 Thread jadamwil
I found the problem: I thought it was opening in binary mode on BOTH windows and the mac, but on windows I passed rb with double quotes, not 'rb' with single quotes to the open file function. Changing it to 'rb' fixed it. On Jul 23, 8:25 am, Tommy Nordgren [EMAIL PROTECTED] wrote: One question :

Re: fromfile error on windows, not mac

2008-07-23 Thread Manu Hack
On Wed, Jul 23, 2008 at 3:37 PM, jadamwil [EMAIL PROTECTED] wrote: I found the problem: I thought it was opening in binary mode on BOTH windows and the mac, but on windows I passed rb with double quotes, not 'rb' with single quotes to the open file function. Changing it to 'rb' fixed it.

Re: fromfile error on windows, not mac

2008-07-23 Thread Fredrik Lundh
Manu Hack wrote: by the way, anyone could explain why changing to single quote makes a difference? rb == 'rb' True There's no difference between single quotes and double quotes in Python. My guess is cargo cult debugging. /F -- http://mail.python.org/mailman/listinfo/python-list

Re: fromfile error on windows, not mac

2008-07-23 Thread jadamwil
On Jul 23, 3:30 pm, Fredrik Lundh [EMAIL PROTECTED] wrote: Manu Hack wrote: by the way, anyone could explain why changing to single quote makes a difference?   rb == 'rb' True There's no difference between single quotes and double quotes in Python.     My guess is cargo cult

Re: fromfile error on windows, not mac

2008-07-22 Thread Uwe Schmitt
jadamwil schrieb: Hello, I am using the numpy fromfile function to read binary data from a file on disk. The problem is that the program runs fine on a Mac, but gives an error or warning on windows when trying to read the data. I use it like this: Signal = zeros((N, 16), dtype=float32)

Re: fromfile error on windows, not mac

2008-07-22 Thread jadamwil
On Jul 22, 2:05 am, Uwe Schmitt [EMAIL PROTECTED] wrote: jadamwil schrieb: Hello, I am using the numpy fromfile function to read binary data from a file on disk. The problem is that the program runs fine on a Mac, but gives an error or warning on windows when trying to read the data. I

Re: fromfile error on windows, not mac

2008-07-22 Thread jadamwil
On Jul 22, 8:35 am, jadamwil [EMAIL PROTECTED] wrote: On Jul 22, 2:05 am, Uwe Schmitt [EMAIL PROTECTED] wrote: jadamwil schrieb: Hello, I am using the numpy fromfile function to read binary data from a file on disk. The problem is that the program runs fine on a Mac, but gives

Re: fromfile error on windows, not mac

2008-07-22 Thread Scott David Daniels
jadamwil wrote: On Jul 22, 2:05 am, Uwe Schmitt [EMAIL PROTECTED] wrote: jadamwil schrieb: Hello, I am using the numpy fromfile function to read binary data from a file on disk. The problem is that the program runs fine on a Mac, but gives an error or warning on windows when trying to read