python3 and python2 file conversion
NOTE: Based on an example python2 python3 turn, turn python3 To python2, the code can 2to3 3to2 to
Steps:
- Installation 3to2 Library ->
pip3 install 3to2
- Locate the file
3to2
, the file is no suffix, python path in the Scripts folder. (anaconda is the same) - Open cmd, use cd switched path to your
3to2
case file path - Enter
python 3to2 -w [你要转换的文件地址]
to complete the conversion
Description:
- Conversion is converted directly in the original code base, so it is necessary to retain the original document, a copy of the operation in advance
- You can batch convert files, the folder address can fill