How to convert python3.4 programs to python2.7, not python2.7 to python3
我想大声告诉你2017-06-12 09:28:55
Convert Python 3 to Python 2 and install 3to2
Installation: pip install 3to2
, run: 3to2 file.py
, see 3to2 --help
漂亮男人2017-06-12 09:28:55
To convert Python3 to Python2, you can generally use 3to2. Of course, you can also use some six-like modules to achieve 2-compatibility. In more cases, developers need to do it themselves.
Generally, it is upgraded from 2 to 3, and in rare cases it is downgraded from 3 to 2.