confusion about opening files

robie1373 robie at 1373.net
Tue Sep 24 04:30:21 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?





More information about the Python-list mailing list