Opening file problem in wxWindows program
David Ishee
isheedm at yahoo.com
Thu Sep 14 13:58:59 EDT 2000
"Fredrik Lundh" <effbot at telia.com> writes:
> > from wxPython.wx import *
>
> note that from-import imports *all* functions and
> names from the module:
>
> - maybe wxPython.wx contains an open function?
See exception #1.
> > from os import *
>
> - maybe os contains an open function? (it does)
Doh!
> > from string import *
>
> - maybe string contains an open function?
??
> just follow the Import Rule:
>
> "Always use import.
>
> As usual, there are a number of exceptions to this rule:
>
> 1. The Module Documentation Tells You To Use from-import.
> 2. You're Importing a Package Component.
> 3. You Don't Know the Module Name Before Execution.
> 4. You Know Exactly What You're Doing."
>
> from http://www.pythonware.com/people/fredrik/fyi/fyi06.htm
> (see the webpage for more info)
>
> looks like you broke rule four ;-)
It's not broken! Its just a flesh wound!
I saw in the wxWindows docs to use the import * statement so I copied
and pasted for the others. Thanks for the help.
David
More information about the Python-list
mailing list