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
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.
A lot of libraries of Python 2 are not forward compatible. A lot of libraries are created in Python 3 to be strictly used with Python 3. Python 2 is no longer in use since 2020. Python 3 is more popular than Python 2 and is still in use in today's times.
Python version 3 is not backwardly compatible with Python 2. Many recent developers are creating libraries which you can only use with Python 3. Many older libraries created for Python 2 is not forward-compatible.
Python 2.6 includes many capabilities that make it easier to write code that works on both 2.6 and 3. As a result, you can program in Python 2 but using certain Python 3 extensions... and the resulting code works on both.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With