On 10-03-2015 12:41, random...@fastmail.us wrote: > On Tue, Mar 10, 2015, at 00:01, Paulo da Silva wrote: >> For .pnm photo files I read the entire file (I needed it in memory >> anyway), splited a copy separated by b'\n', got the headers stuff and >> then used the original remaining bytes as the photo pixels. >> But this is very tricky! I am on linux, but if I ran this program on >> windows I needed to change it to "eat" also the '\r'. > > Why? The file is the same file. If the .pnm format is allowed to have a > '\r' there, you're just as likely to have to deal with it in Linux. > Yes, but I'm creating and reading the files in linux. .pmm is just an example I'm facing now but my question was more general.
According to the response of Cameron, this can be handled with 'strip'. -- https://mail.python.org/mailman/listinfo/python-list