views:

107

answers:

3

Hi all -

I'm going to start on a long (~1-year) programming project in Python. I want to use wxPython for my GUI (supports 2.6), but I also want to use 3.1 for the rest of the project (to start using the 3.x syntax).

Is there any way for me to design a project that mixes 2.x and 3.x modules? Or should I just bite the bullet and use either 2.x (preferred, since I really want to learn wxPython) or 3.x throughout?

Thanks,

Mike

+5  A: 

You should use python 2.7 (a release candidate is expected in the next days) that is very close to python 3.1 and to code taking care of no using deprecated features. There is a recent version of wxpython for python 2.7. After wxpython gets 3.1-3.2 builds, conversion of the code should not be too hurting. Still, wxpython has no deadline for the transition :-(

Another option is to use pyQt that already has builds for python 3.1

joaquin
+1 for pyQt. pyQt also currently has the advantage of a better availability on Mac OS X (it's available through Fink, while wxPython is not).
EOL
+3  A: 

Python 2 and 3 are not that different. If you have learned Python 2 well, it will be a matter of minutes to get acquainted with Python 3. The official recommendation says that you should use Python 2.6 (the current version) and try to be forward-compatible. Python 3 is currently not an option for large projects as virtually none of the popular packages have been translated yet. But development of Python 2 and 3 will continue in parallel for a long time, so you won't lose much by not using Python 3. You can import many syntactical features of 3 (Unicode string literals, division, print function, absolute imports) using the __future__ module, and the standard library remains mostly the same. So I'd recommend using Python 2.

Philipp
+1  A: 

mixing the ability to use wxPython (2.x) + with learning new syntax (3.x)

Don't "mix".

Write Python 2. Get it to work.

Play with Python 3 separately. Don't "mix".

When the various packages and modules are available in Python 3, use the 2to3 conversion to create Python 3. You'll find some small problems. Fix your Python 2 so that your package works in Python 2 and also works after the conversion.

Then, you can drop support for Python 2 and focus on Python 3.

Don't "mix".

S.Lott