views:

100

answers:

2

I've written my code to target Python 2.6.5, but I now need to run it on a cluster that only has 2.5.4, something that wasn't on the horizon when I wrote the code. Backporting the code to 2.5 shouldn't be too hard, but I was wondering if there was either a cheat-sheet or an automated tool that would help me with this. For some things, like the with statement, the right __future__ imports will do the trick, but not for some other things.

+7  A: 

Have you read the What's New in Python 2.6 document? It describes the 2.5->2.6 direction, but you should be able to figure out the reverse from it.

As far as I know, there are no automated tools for 2.6 to 2.5. The only tool I know of is the 2to3 app for going to Python 3.

Mike DeSimone
Thanks for the answer. I just ended up installing my own Python in my home directory though.
Chinmay Kanchi
+3  A: 

Have you tried pyqver? It will tell you which is the minimum version of Python required by your code

I hope it helps

luc
Good idea, but I already know my code requires 2.6 :)
Chinmay Kanchi
+1 for the pointer to `pyqver`.
martineau