Unable to run basic WxPython GUI script from tutorial. Inconsistences in Windows 7, bad install?

This list is a very very very friendly and helpful list. Don’t get
frustrated on problems, just before you get there you should ask a
question here and I am sure people will help. I now use
Python/wxPython for a few years and have created my own little
shareware application and I only managed to do this as lots of
people helped me on this list.
As others suggest install the wxPython demo - if it works then your
installation is fine.
Or another check would to try the very very basic “A first
Application: Hello, World” on the wxPython wiki:
If you look for a tutorial then check this one out:
Werner

···

hi Michael,

  On 22/01/2013 23:02, Michael Webb wrote:

General Information:

    I hear a lot of great things about wxpython,

and I want to
get familiar with using the GUI, so I’ve made several stabs at
getting it to
work. I’ve been trying to get wxpython
to work consistently on my machine for many months, having
abandoned it and
walked away several times and then come back to experience more
frustration.

    I have the very strong feeling that there is

something wrong
with my installation, but I don’t understand what it is. I have
installed and re-installed the package
and nothing helps. I install python
scripts by directly copying the entire script from a web page
and running it…
and it doesn’t do the same thing on my machine it does on other
machines. Frequently it creates a window with no
widgets, and can only be closed through the task manager, as in
this case. It’s driving me insane.

http://wiki.wxpython.org/Getting%20Started#Getting_started_with_wxPython

    I used to like python but i'm wondering if

I’d should walk
away from the language at this point, maybe try to learn
programming with a
different language because the inconsistences are making it
impossible for me
to progress now. I don’t know how to
learn a language that seems to perform differently for everyone
else.

    I run Windows 7, Python 2.7.3, and use the

Idle GUI. If anybody has experienced similar problems
please let me know.

Specific Script:

    I copied this script from a tutorial.

Evidently it works for most people, but in my
case it opens a window labeled wxHello with the inside greyed
out and no
widgets.

http://zetcode.com/wxpython/

Hi Michael,

I just tracked down what I believe to be the tutorial you followed: http://www.learningpython.com/2007/01/29/creating-a-gui-using-python-wxwidgets-and-wxpython/

I think I see how you fell into the trap of defining a stand-alone function instead of modifying the existing create_controls function/method defined in the wxHelloFrame class. The text of that tutorial states: “Now we are going to start adding the widgets to the frame in the create_controls() function”. However, in a tutorial that is aimed at people new to wxPython a better wording would, in my opinion, have been: "Now we are going to start adding the widgets to the application by modifying the create_controls() function defined in the wxHelloFrame class.

Actually, in my opinion it is better to use the word “method” when describing code in a class definition in order to remove confusion with ordinary stand-alone functions.

Anyway, the code and tutorial link that I supplied earlier probably explains this better than than the above. Let us know how you get on!

Cheers!!

Dermot.

···

On 23 January 2013 10:39, Werner werner.bruhin@sfr.fr wrote:

hi Michael,

  On 22/01/2013 23:02, Michael Webb wrote:

General Information:

    I hear a lot of great things about wxpython,

and I want to
get familiar with using the GUI, so I’ve made several stabs at
getting it to
work. I’ve been trying to get wxpython
to work consistently on my machine for many months, having
abandoned it and
walked away several times and then come back to experience more
frustration.

This list is a very very very friendly and helpful list.  Don't get

frustrated on problems, just before you get there you should ask a
question here and I am sure people will help. I now use
Python/wxPython for a few years and have created my own little
shareware application and I only managed to do this as lots of
people helped me on this list.

    I have the very strong feeling that there is

something wrong
with my installation, but I don’t understand what it is. I have
installed and re-installed the package
and nothing helps. I install python
scripts by directly copying the entire script from a web page
and running it…
and it doesn’t do the same thing on my machine it does on other
machines. Frequently it creates a window with no
widgets, and can only be closed through the task manager, as in
this case. It’s driving me insane.

As others suggest install the wxPython demo - if it works then your

installation is fine.

Or another check would to try the very very basic "A first

Application: Hello, World" on the wxPython wiki:

http://wiki.wxpython.org/Getting%20Started#Getting_started_with_wxPython

    I used to like python but i'm wondering if

I’d should walk
away from the language at this point, maybe try to learn
programming with a
different language because the inconsistences are making it
impossible for me
to progress now. I don’t know how to
learn a language that seems to perform differently for everyone
else.

    I run Windows 7, Python 2.7.3, and use the

Idle GUI. If anybody has experienced similar problems
please let me know.

Specific Script:

    I copied this script from a tutorial.

Evidently it works for most people, but in my
case it opens a window labeled wxHello with the inside greyed
out and no
widgets.

If you look for a tutorial then check this one out:

[http://zetcode.com/wxpython/](http://zetcode.com/wxpython/)



Werner

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en