Automated tool to modify python source to support 2.7 and 3.4
Question: We want to support Python 2.7 and 3.4+ from one code base in the future.

I searched for automated tools, but lib2to3 seems to only support Python 3 in
the result.

I know that the library six could help us, but we have a lot of Python source
files.

My dream: A tool that adds this (or even more future imports) to each file:

    
    
    from __future__ import absolute_import, division, unicode_literals, print_function
    

and the tool should update:

  * all `u'...'` \--> `'...'`
  * `print foo` \--> `print(foo)`
  * ...


Answer: This should work, but up to now untested:

  1. use [2to3](https://docs.python.org/2/library/2to3.html)
  2. use [3to2](http://www.startcodon.com/wordpress/category/3to2/)

