wxPython - wx package (new style wxPython?)

Mel Wilson mwilson at the-wire.com
Wed Nov 26 21:01:04 EST 2003


In article <pan.2003.11.26.00.01.58.810779 at phreaker.nospam>,
Logan <logan at phreaker.nospam> wrote:
>Would you recommend to use the wx package of wxPython?
>
>From the documentation:
>
>  Provides a way to drop the wx prefix from wxPython objects by
>  dynamically loading and renaming objects from the real wxPython
>  package.  This is the first phase of a transition to a new style
>  of using wxPython.  For example:
>
>      import wx
>      class MyFrame(wx.Frame):
>      ...
>
>  instead of:
>
>      from wxPython.wx import *
>      class MyFrame(wxFrame):
>      ...
>
>What does 'this is the first phase of a transition to a new style
>using wxPython' in the above mean? Will this new style become the
>only way to use wxPython in future releases?

   I think it's on the whole an improvement.  One thing I've
found with the current version is that in a sub-module, only
the old style works, that is in a two-file program, the
setup:

File dbmaint.pyw:

        import wx
        import personalcontact
...


File personalcontact.py:

        from wxPython.wx import *
...


is the only arrangement that works for me.  I suspect that
the wx.py file contrives to build the wx symbol structure in
the invokers namespace, and only operates once.  I assume
(if I'm right) that that's something to be fixed when the
new scheme becomes standard.

        Regards.        Mel.




More information about the Python-list mailing list