alf <[EMAIL PROTECTED]> writes:

> wonder if in the python I could treat modules imorts like classes
> instances. It means I could import it twice or more times under
> different names.

No need to import more than once. The 'import' statement binds a
module object to the specified name, and you can bind as many names as
you like to the same object.

    >>> import sys
    >>> foo = sys
    >>> bar = sys
    >>> print sys.maxint
    2147483647
    >>> print foo.maxint
    2147483647
    >>> print bar.maxint
    2147483647

-- 
 \           "Laugh and the world laughs with you; snore and you sleep |
  `\                                             alone."  -- Anonymous |
_o__)                                                                  |
Ben Finney

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to