File creation, polluted name space?

Derek Rhodes rhoder at worldpath.net
Sun Feb 15 10:36:45 EST 2004


This is a python session I had running
Python 2.3.3 (win32)

-----------------------------------------------
IDLE 1.0.2
>>> infile = open("file1", 'w')        #this works
>>>
>>> import os
>>> infile = open("file2", 'w')        #it still works
>>>
>>> from os import *
>>> infile = open("file3", 'w')        #fails

Traceback (most recent call last):
  File "<pyshell#4>", line 1, in -toplevel-
    infile = open("file3", 'w')
TypeError: an integer is required
>>>
----------------------------------------------------------
after I < from import os * > I can't seem to create a file
by the method shown above.

The error indicates that an integer is required,
however, I don't see how an integer would fit
in here.
Does anyone know what's going on?
Is the name space being polluted?

-derek





More information about the Python-list mailing list