Hello,
I've got a problem with executing a python script in different environments with different versions of the interpreter, because the way text is formatted differ from one version to another.
In python < 2.6, it's done like this:
n = 3
print "%s * %s = %s" % (n, n, n*n)
whereas in python >= 2.6 the best way to do it is:
n = 3
print "{0} * {0} = {1}".format(n, n*n)
But how about when you want the script to be runned in any python version? What's better, to write python<2.6 code to assure instant compatibility or use the python>=2.6 code that is going to be the way it's used in the future?
Is there any other option to write code for the actual python versions without loosing compatibility with olders?
Thanks