954,525 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Instal of wxPython

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?

bumsfeld
Nearly a Posting Virtuoso
1,445 posts since Jul 2005
Reputation Points: 404
Solved Threads: 184
 

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

wally_lawless
Light Poster
26 posts since Oct 2005
Reputation Points: 10
Solved Threads: 0
 

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?

bumsfeld
Nearly a Posting Virtuoso
1,445 posts since Jul 2005
Reputation Points: 404
Solved Threads: 184
 

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

wally_lawless
Light Poster
26 posts since Oct 2005
Reputation Points: 10
Solved Threads: 0
 

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")
vegaseat
DaniWeb's Hypocrite
Moderator
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
 

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?

bumsfeld
Nearly a Posting Virtuoso
1,445 posts since Jul 2005
Reputation Points: 404
Solved Threads: 184
 

I would also recommend taking a look at the wxPython Wiki , this is where I learned most of what I needed to get started and the content is pretty good.

I'll be posting some examples soon once I've got my programs complete and working.

Wally
www.power-coder.net

wally_lawless
Light Poster
26 posts since Oct 2005
Reputation Points: 10
Solved Threads: 0
 

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

mawe
Junior Poster
133 posts since Sep 2005
Reputation Points: 19
Solved Threads: 58
 

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!

vegaseat
DaniWeb's Hypocrite
Moderator
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
 

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.

bumsfeld
Nearly a Posting Virtuoso
1,445 posts since Jul 2005
Reputation Points: 404
Solved Threads: 184
 

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

wally_lawless
Light Poster
26 posts since Oct 2005
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You