Weird Problem

Carl Banks imbosol at aerojockey.invalid
Thu Aug 21 07:23:08 CEST 2003

Kris Caselden wrote:
> I'm sure this is a simple newbie problem, but I can't figure it out
> for the life of me.
> The code:
> import sys, os
> input = open("","r")
> Gives me the error:
> TypeError: an integer is required

I'm going to guess.  I'll bet you used "from os import *" somewhere
above that.  os has a function "open" that closely interfaces the
operating system's open call--and the second argument has to be an

BTW, you don't know this, but since you're using 2.3, you should
probably start using "file" instead of open:

    input = file("","r")

CARL BANKS         
"You don't run Microsoft Windows.  Microsoft Windows runs you."

More information about the Python-list mailing list