Okay I have copy and pasted the code from the tutorial on the jpg image http://daniweb.com/techtalkforums/thread33791.html onto my IDE editor. This time no problem with indents!

Now I need to know how to instal required wxPython. I have Windows XP, also Python 2.4. Where do I best get free wxPython and which version?

Here's the URL to get the wxPython binaries for WinXP link current version is 2.6.1.0 and will work with Python 2.4. Just make sure that the Python 2.4 version is one that you download and you're set.

It's pretty powerful once you get used to it, have fun!

Wally
www.power-coder.net

Thanks you much wally,

I downloaded wxPython2.6-win32-unicode-2.6.1.0-py24.exe from
http://www.wxpython.org/download.php#binaries and installed it. The code works greatly.

I was looking through the files it instaled, but could not find a file wx.py. I thought when I import one module it is such a file. How does it work here?

I just checked out my system the file is installed in the following location:

C:\Python24\Lib\site-packages\wx-2.6-msw-ansi\wxPython the actual file name is _wx.py which might explain why you couldn't find it.

Shouldn't make a difference for when you're writing your code though, you don't need to know where the file is, the Python interpreter takes care of that for you.

Welcome to the wonderful world of wxPython, what's your first project going to be?

Wally
www.power-coder.net

Actually wx is a package rather than a file. With a package you should have a folder called wx and within it a file called __init__.py that declares the package. The overall effect is the same. Using wx as the namespace is the more modern convention. This way you are using wx.Button, wx.Panel, wx.Frame, wx.ImageFromStream and so on.

I like it, because it lets you know where functions and constants come from.

Learning wxPython is a little steep at first but very rewarding. Some of the documentation is rather poor, and good sample code is rare. Luckily, with Python you can experiment easily and figure things out! You can also use the Boa Constructor IDE to build wxPython code quickly.

Edit: If you want to know the packages amongst your modules simply run ...

help("modules")

You right! Documentation is for C++ and no examples. So I hope you and others will be posting good examples, right?

Are any good tutorials out?

Hi!

You right! Documentation is for C++ and no examples.

wxPython comes with a great demo, with examples for (nearly) all widgets. It's this demo you should look at first, if you want to learn wx ;) The wiki is also nice, but a little outdated.

Regards, mawe

I would agree with mawe, the wxPython2.6-win32-docs-demos-2.6.1.0.exe file is pretty good. You have to download it (from the same site) and install it separately!

Wally wanted to know what your first project is? I am curious too!

Now I know which demo mawe was meaning. I downloaded the extra file and instaled it. There are nice examples now!

The project I am working with is a color match skill program. I have a frame, 2 panels, 3 sliders, label and buttons. One panel is colored with random (R,G,B) by the program, then I use sliders R,G, and B to try to match. When done I press button to evaluate and program tells me how close I was, some kind of rating will be done. Supposed to help eye patients.

Wow, good job on picking a first project! That actually sounds pretty cool. wxPython shouldn't make things too difficult for you either. Good luck! Would love to see a demo when it's finished.

Wally
www.power-coder.net

This question has already been answered. Start a new discussion instead.