How to call built in function 'open' from inside object that has 'open' method?

Aahz aahz at pythoncraft.com
Wed Apr 30 09:47:38 EDT 2003


In article <db81c492.0304300526.7b8d3c86 at posting.google.com>,
vadim <vf at interna.ru> wrote:
>
>I am new to Python and do not know the answer to very simple how to
>'open' from inside another object that has 'open' method. I know that
>in C++ I should use following syntax ::open.
>
>More details on reasons. I have met this problem trying to write a
>simple script use ActiveScripting inside IE.  I am trying "file =
>open(...) but because context window object has 'open' method that
>just opens window it is called first. Sorry for simple question. I was
>trying to find the answer but either it is not on the surface or too
>simple.

Two options:

* Python 2.2+, use file()

* import __builtin__; __builtin__.open()
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"In many ways, it's a dull language, borrowing solid old concepts from
many other languages & styles:  boring syntax, unsurprising semantics,
few automatic coercions, etc etc.  But that's one of the things I like
about it."  --Tim Peters on Python, 16 Sep 93




More information about the Python-list mailing list