Differences between revisions 3 and 4
Revision 3 as of 2001-11-01 19:49:38
Size: 3329
Editor: anonymous
Comment: missing edit-log entry for this revision
Revision 4 as of 2001-11-01 19:50:19
Size: 3333
Editor: anonymous
Comment: missing edit-log entry for this revision
Deletions are marked like this. Additions are marked like this.
Line 73: Line 73:
is also the C++GuideForwxPythoneers page on this site to help you further. is also the ["C++GuideForwxPythoneers"] page on this site to help you further.

How to learn wxPython.

We have had a lot of questions on the newsgroup asking how to go about learning wxPython. this page gives some pointers on how to do just that.

First of all, if you are new to Python, and especially if you are new to programming in general, it makes the most sense to learn Python itself first, without any GUI stuff. This can be frustrating if your goal is to write GUI programs, and particularly if you have experience with an environment like Visual Basic in which GUI programming is integrated into the environment. It is worth it, however, to take some time to learn about Python. Python is a very powerful language capable of doing many things both with and without GUIs.

Using wxPython requires a pretty good understanding of Object Oriented (OO) programming in Python, and all of the tutorials and references that I will refer to later assume this knowledge.

To learn Python, go to the Python for Beginners page at the main Python web site:

http://www.python.org/doc/Newbies.html

Follow the links on that page, and you should find something to your liking. If you are already familiar with programming but still need to learn Python, then the Python Tutorial is a good place to start:

http://www.python.org/doc/current/tut/tut.html

Once you have a fundamental understanding of programming in Python, you can start to learn wxPython for GUI programming.

I would suggest starting with the Tutorial. It is brief, and not complete, but it is a good start. You can find it here:

http://wxpython.org/tutorial.php

Once you have gone through that, you might want to go through the wxpython wiki getting started section:

http://wiki.wxpython.org/index.cgi/Getting_20Started

Between these two, you should have a basic grasp of how wxPython works, and be ready to make your own application. To do this, you will want two things: examples and a reference.

The wxPython demo is your best source of examples. It is distributed with wxPython, and demonstrates virtually all the features of wxPython. When you run it, you can see how different features work, and see the source code that made it happen. Many of us look for something in the demo that is close to what we want to do, copy it, and then alter it to fit our needs.

Another source of examples is the wxPython cookbook:

http://wiki.wxpython.org/index.cgi/wxPython_20Cookbook

The reference manual for wxPython is the same as the reference for the C++ version of wxWindows, and can be found here:

http://www.wxpython.org/onlinedocs.php

It is written in C++ syntax, with notes inserted for when the Python implementation differs from the C++. The fact that the docs are written for C++ is unfortunate, not because they aren't useful to Python programmers, but because is can be very intimidating to new users who don't know C++. In fact, many Python programmers who don't know a bit of C++ find that the docs can be very useful. It only takes a little while to learn to translate form the C++ in the docs to the equivalent Python. One of the best way to learn to do this is to compare code form the examples n the wxPython demo to what is in the reference manual. There is also the ["C++GuideForwxPythoneers"] page on this site to help you further.

wxPython by Example (last edited 2012-06-28 08:10:48 by SWM-HIGH-SPEED2-22)

NOTE: To edit pages in this wiki you must be a member of the TrustedEditorsGroup.