from wxPython.wx import *
from wxPython.grid import *
there may be a work around, but that is a VERY old import style!
you never want to do “import *” – trust me on that.
Yes, That is very old import style and should be eradicated from the general education/demo…
NOTE: If you absolutely have to rely on these versions then it is OK in this instance.
As far as a wildcard import, yes it is usually rare that a programmer should use this.
Ex:
from Constants import *
Usually only specific stuff that will be considered Global in the programmers mind and not to be changed after point of import.
Translated: from Module import EVERYTHING and then some…
Instead of default ids, pos, sizes, similar in this case, import defId, defPos, defSize from a *ConstantsModule.py
And let’s say I want a function sucth as translation…
Ex:
from src.Constants import *
or
from src.Constants import _, defId, defPos, defSize
If I do this the func will cause problems unless specifically imported into namespace…
as where if I do those manually it is ok, but only if the programmer explicitly knows the whole or part of the situation import at hand.
So, in a nutshell… basically don’t use wildcard imports(import *) unless you know that everything you want out of a module will be global, or maybe you are specifically targeting something(debugging oftentimes).
import wx
…is all you really need anyway, since you can get to anything you need from here anyway.
importing specific modules specifically comes with knowledge of how to use them also with the fact that you are not going to overide them with other imports from, example a different library that has similar or same name for stuff.
Ex: open and close keywords are common here.
from * import *
Use with care!
···
On Wednesday, December 4, 2013 6:16:06 PM UTC-6, Chris Barker wrote:
On Mon, Dec 2, 2013 at 10:43 PM, Erxin shang...@hotmail.com wrote: