Q: How to port an entire project to python 3 using 2to3?

Python3 Python 2to3

Answer:

To port an entire project directory from python 2 to python 3, you can use the 2to3 tool, which comes with python 3 by default.

2to3 --output-dir=project-python3 -W -n project-python2

On windows, this tool is usually located in the Tools/scripts folder inside your python installation folder. If you don't have this directory in your environment path. Use the command below.

cd c:\your\python\Tools\scripts\
python 2to3.py --output-dir=project-python3 -W -n project-python2

    No comments found for this tutorial, be the first to leave a comment!

Answered by
Double

Last updated on
Apr 20, 2017

Share