search

Home  >  Q&A  >  body text

python3.x - How to convert python3.4 programs to python2.7

How to convert python3.4 programs to python2.7, not python2.7 to python3

滿天的星座滿天的星座2729 days ago1020

reply all(2)I'll reply

  • 我想大声告诉你

    我想大声告诉你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

    for details

    reply
    0
  • 漂亮男人

    漂亮男人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.

    reply
    0
  • Cancelreply