[portland] Reformatting Data Files

John Hampton pacopablo at pacopablo.com
Sat Jan 29 02:51:45 CET 2011


On 1/28/11 4:36 PM, Rich Shepard wrote:
> Interestingly, I had to specify binary mode when reading ("rb" rather than
> "r") because csv.reader() needs binary mode for some reason I don't
> understand. It is a text file, but that's just the way it works I guess.

I'm assuming that you're running this code on a Windows machine.  On 
*nix [1], 'r' == 'rb'.  However, on Windows, you have to specify binary 
so that the OS doesn't do any line-ending munging.

-John

[1] At least on all *nix that I've used.


More information about the Portland mailing list