View Single Post
Old 09-30-2014, 01:34 AM   #65
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,450
Karma: 27757438
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I strongly suggest you stick with python 2.x, if you are choosing a single python version. The python developers would really, really like python 2.x to die, but unfortunately for them, they did not introduce any sufficiently important new features to python 3 to make it worth the effort of migrating a large existing codebase. So the vast majority of python code will remain python 2, certainly for several years, probably forever. Furthermore, it is pretty easy to write python 2 code in a way that it can be easily ported to python 3 in the future.
Simply stick the following at the start of all the .py files:

Code:
from __future__ import (unicode_literals, division, absolute_import, print_function)
Then, in the future migrating to python 3 is mostly just a matter of changing a few names for standard library modules/functions, which the 2to3 tool does automatically.

And note that python 2.8 will be released soon.
kovidgoyal is offline