confusion about opening files
marklists at mceahern.com
Tue Sep 24 04:44:13 CEST 2002
> I am trying to open a file,
> >>> import os
> >>> file = os.open("e:\\d12", "r")
> Traceback (most recent call last):
> File "<pyshell#4>", line 1, in ?
> file = os.open("e:\\d12", "r")
> TypeError: an integer is required
> I get this error if the mode is r, r+, a+ or whatever. I also get it
> whether the file exists or not. Can someone explain what I am doing wrong?
This is a FAQ. You should probably find the Python FAQ and read it. Short
story: Don't use 'from x import *' unless you know what you're doing.
More information about the Python-list