How to force built-in commands over imported.

Simon Brunning SBrunning at
Wed Sep 4 10:53:34 EDT 2002

> From:	Maurice van de Rijzen [SMTP:maurice at]
> 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.
You are, I assume, importing 'os' as follows:

from os import *

*Don't* *do* *this*. Use:

import os

instead. There *are* reasons for using the former method, but they are few
and far between. The latter form should always be the one you use unless you
have a good reason.

Simon Brunning
TriSystems Ltd.
sbrunning at

The information in this email is confidential and may be legally privileged.
It is intended solely for the addressee. Access to this email by anyone else
is unauthorised. If you are not the intended recipient, any disclosure,
copying, distribution, or any action taken or omitted to be taken in
reliance on it, is prohibited and may be unlawful. TriSystems Ltd. cannot
accept liability for statements made which are clearly the senders own.

More information about the Python-list mailing list