[Tutor] Windows - Linux based open() file handle mode

Kent Johnson kent37 at tds.net
Mon Nov 19 23:57:18 CET 2007


Srinivas Iyyer wrote:
> Dear group, 
> 
> I want to parse an file generated for windows.
> My code works beautifully when I try to parse the same
> file generated in Linux. 
> 
> I uses the following options with no success:
> 
> blast_out = open('C:\human\prb_blast.out','r')
> 
> blast_out = open('C:\human\prb_blast.out','rU')
> 
> blast_out = open('C:\human\prb_blast.out','U')

Presumably the file is a text file? What kind of error do you get? Have 
you looked at the file and compared it with the same file generated on 
Linux? Are you using a recent version of Python? (the U options were 
introduced in 2.3)

Kent


More information about the Tutor mailing list