[Tutor] quick question to open(filename, 'r') vs. file(filename, 'r')

David ldl08 at gmx.net
Mon May 4 23:40:21 CEST 2009


Dear list,

in different books I come across different syntax for dealing with
files. It seems that open(filename, 'r') and file(filename, 'r') are
used interchangeably, and I wonder what this is all about. Is there a
reason why Python allows such ambiguity here?

Cheers for a quick shot of enlightenment ;-)

David


More information about the Tutor mailing list