confusion about opening files

Max M maxm at mxm.dk
Tue Sep 24 10:47:16 CEST 2002


Mark McEahern wrote:

> I should have read the post I was replying to more carefully.  I saw the
> "integer required" error and didn't notice that the OP was using os.open.
> So the 'from x import *' was a red herring.  As Erik Max Francis pointed
> out, the OP should use open instead of os.open.


Actually he should use file() as open() is deprecated (well sort of ;-) )

"2.1 Built-in Functions
The file() constructor is new in Python 2.2. The previous spelling, 
open(), is retained for compatibility, and is an alias for file(). "


regards Max M




More information about the Python-list mailing list