How to force built-in commands over imported.
mmoales at fluent.com
Thu Sep 5 16:48:40 CEST 2002
How did you import the os module? I'm guessing you did:
from os import *
If you just do:
then when you invoke open, you'll be using the builtin function. Of
course, all of your os function calls will need to be prefixed with
"os.", but you won't have anymore name clashes.
Maurice van de Rijzen wrote:
> Dear all.
> I'm a newbie on the field of python, therefore the answer to my question
> may be simple.
> There is a built-in commans called open(fileName). There is also a
> open() command in the os-module open which needs more than the fileName.
> Originally I didn't import the os-module and everything worked fine.
> However, when I imported the os-module I received an error that open
> needed more arguments. How can I force to take the built-in open()
> instead of the open() in the os-module.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 281 bytes
Desc: Card for Mark Moales
More information about the Python-list