472,951 Members | 2,145 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,951 software developers and data experts.

wxPython - wx package (new style wxPython?)

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?

Thanks in advance for any answers.

--
mailto: logan@phreaker(NoSpam).net

Jul 18 '05 #1
6 2158
On Wed, 26 Nov 2003 01:01:59 +0100, Logan wrote:
Would you recommend to use the wx package of wxPython?
Because it removes the redundancy in the module object names, yes. As
for any other qualities the 'wx' package might have, I can't say; if
it's exactly the same functionality and call styles as the existing
wxPython.wx then I can't see a reason not to use it.
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.

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?


'from foo import *' is heavily deprecated in any case; this "new style
of using wxPython" is merely saying (AIUI) that the 'wx' package allows
a more natural usage of wxPython objects without needing to use a
deprecated import style.

--
\ "Quidquid latine dictum sit, altum viditur." ("Whatever is |
`\ said in Latin, sounds profound.") -- Anonymous |
_o__) |
Ben Finney <http://bignose.squidly.org/>
Jul 18 '05 #2
Bah, I think they are just over-glorifying the change. In my
mind, it's the same exact thing. The only real different is when you
"from wxPython.wx import *" it reads everything into your local
namespace which is traditionally considered not the best thing to do.
I really have no idea if the "transition" when finished will remain
backwards compatible, but I'm guessing from the description of the
implementation that it is.

BTW, In the future you may want to use a real email address so that you
can receive an answer.

On Tue, 2003-11-25 at 19:01, Logan 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?

Thanks in advance for any answers.

--
mailto: logan@phreaker(NoSpam).net

Jul 18 '05 #3
On Tue, 25 Nov 2003 19:20:08 -0500, James Tanis wrote:
BTW, In the future you may want to use a real email address
so that you can receive an answer.


Thanks for your comments regarding my question.

About the 'real email address':

I do use a real address! You can find the address in the
signatures of my postings; just remove the part saying '(NoSpam)'.

I don't use the real address in the headers of my postings
(but: lo***@phreaker.nospam) because the last time (about a
month ago) I used my real address, I got thousands and thousands
of SPAM mails, viruses etc. per week. This was really annoying.

--
mailto: logan@phreaker(NoSpam).net

Jul 18 '05 #4
I just finished a moderate sized wxPython app from scratch using wx and I'm
happy I did. There were a few times I had to put my thinking cap on, but it
worked out well.

"Logan" <lo***@phreaker.nospam> wrote in message
news:pa****************************@phreaker.nospa m...
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?

Thanks in advance for any answers.

--
mailto: logan@phreaker(NoSpam).net

Jul 18 '05 #5
In article <pa****************************@phreaker.nospam> ,
Logan <lo***@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.
Jul 18 '05 #6
James Tanis <jt****@charter.net> writes:
Bah, I think they are just over-glorifying the change. In my
mind, it's the same exact thing. The only real different is when you
"from wxPython.wx import *" it reads everything into your local
namespace which is traditionally considered not the best thing to do.
I really have no idea if the "transition" when finished will remain
backwards compatible, but I'm guessing from the description of the
implementation that it is.


To be honest, for a while now I've often been doing:

from wxPython import wx

and putting up with duplicated references to wx (e.g., wx.wxWindow).
That avoids both the pollution of the local namespace and the overhead
of pulling in the several thousand names (I got a noticeable
performance speed up in an application with many plugins since each
plugin no longer needed to make extra references for all the wx
objects in the plugin's local namespace).

One reason why I haven't moved to the new wx package yet is that it's
implemented as a lazy evaluation approach (probably for performance),
which means it doesn't play nice with interface tools that need
introspection (e.g., IDE completion) which some of my other developers
use. Once wx becomes a full fledged normal module I'd definitely
consider moving to it for the same reasons that I use the above
approach now.

-- David
Jul 18 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: wang xiaoyu | last post by:
Hello: i want use activex in wxpython program,but when i use MakeActiveXClass an exception occurs. this is my source code dealing the DICOM ocx.I must note that in this program "hwtxcontrol" is...
1
by: mdk.R | last post by:
Hello all: i'am installed wxPython 2.5 and Python2.3.4..i try execute script with wxPython but it show error: Traceback (most recent call last): File "E:\py\test.py", line 7, in ? import wx...
25
by: BJörn Lindqvist | last post by:
See: http://www.wxpython.org/quotes.php. especially: "wxPython is the best and most mature cross-platform GUI toolkit, given a number of constraints. The only reason wxPython isn't the standard...
5
by: Daniel Bickett | last post by:
I'm very near finishing a medium to large scale application, so I'm getting a head start on the GUI side of things. Part of the concept is to give as much attention to presentation as...
9
by: amhoov | last post by:
Hi all, I'm trying to install wxPython on Debian using 'apt-get install python-wxgtk2.4.' I've got both Python 2.3 and 2.4 installed with 2.4 set as my default. For whatever reason, wxPython...
0
by: Robin Dunn | last post by:
Announcing ---------- The 2.6.3.0 release of wxPython is now available for download at http://wxpython.org/download.php. There have been many enhancements and fixes implemented in this...
6
by: Robin Dunn | last post by:
Announcing ---------- The 2.6.3.2 release of wxPython is now available for download at http://wxpython.org/download.php. This is a mostly bug fix release and takes care of several "unfortunate...
3
by: SMALLp | last post by:
Hy. I'm new in linux (Ubuntu 7.10) as well as in python. I installed IDLE, and i installed package python-wxgtkX. I start IDLE and when i want co compile my aplication all windows close. Also when...
5
by: blaine | last post by:
The wxPython group is a bit stale compared to this group, so I'll give it a shot :) (READ: Originally when I started htis post, Python 2.5 at the shell did not work (identical behavior to...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.