Question about import
mark at diversiform.com
Tue Aug 5 19:42:40 CEST 2003
The difference is how you access the methods in the module. If you use:
you will only be able to use the Module.Method usage. If you use:
from Module import *
you can access the Methods directly.
The drawback to using from Module import * comes from conflicts if you
import multiple Modules, which may have identically named Methods, where you
will only be able to get the Method from the most recently imported Module.
Better to import the Module, IMO.
Any thoughts, all?
From: python-list-admin at python.org
[mailto:python-list-admin at python.org]On Behalf Of Kevin MacKenzie
Sent: Tuesday, August 05, 2003 9:29 AM
To: python-list at python.org
Subject: Question about import
I'm a complete newbie to using Python. I have a small question about
Is there any difference between the two following statements, and what
(if any) are they?
>>> from Module import *
>>> import Module
More information about the Python-list