Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Python 3.1 and 2.5 together

I'm currently working the final project for my programming class. We're writing it in Python 3.1, and I'm doing the GUI. My team's leader wants to do the whole project in 3.1, but most pyGame addons (like pyConsole) are giving me compatibility issues.

So, my question is, can I write my frontend in 2.5 and then hook it up to the engine that's written in 3.1? Thanks for your help!

like image 795
PintSizeSlash3r Avatar asked May 18 '11 23:05

PintSizeSlash3r


2 Answers

To be honest, that's probably more trouble than it's worth.

Your best bet is to get together and make a list of the addons you guys want to use and whether or not they're compatible with 3.1. Then decide if you can live without the incompatible ones. If you can't, do the project in 2.5, otherwise go with 3.1 and have a "Plan B" for the addons you can't use.

If you're careful you can make switching from 2 to 3 relatively painless later on when those addons add support for 3.x.

If it's a project you plan on working on for a long time (i.e. more than just a class project), I'd probably say go with 3 and try porting some of the addons yourself. But for a class' final project it's probably not worth it.

like image 160
Jeremiah Avatar answered Nov 15 '22 09:11

Jeremiah


Short Answer NO.

Longer Answer. You can write your frontend with Python 2.5 and the backend with 3.0, but they can't interact at all. You need some sort of abstraction layer between them. Doing something like this you can have any language in the other side.

The abstraction Layer would need to pull jobs work on them and push back to some sort of queue. This is just a silly example and can get really complicated as you go by. In the end the abstraction layer may become even more complicated than you application, assuming it's a work for a class.

I'd listen to Jeremiah and discuss with professor about the goods and bads that you have going with Python 2.5 or 3.0. If you include an explanation of the reasons you choose one over the other in your final papper I'm sure you'll get some extra points and he'll hardly penalyze you for it.

like image 28
Eduardo Avatar answered Nov 15 '22 09:11

Eduardo