Python fucking beginners are writing like that.
This time, everything is done at the command prompt.
Because it is assumed that Python3 is already installed
Try typing py </ code> at the command prompt to see if there are any errors.
(
quit () </ code> exits Python's interactive mode)
First, move to the location where the file you want to convert is (in this case, the desktop).
cd C: \ Users \ (user name) \ Desktop </ code>
Next, finally convert from Python2 to Python3! !!
2to3 -w Hello.py
Now "Hello.py" is the code for Pyhon3 The original Python2 code should be "Hello.py.bak" !! ??
'2to3' is an internal or external command, It is not recognized as an operable program or batch file.
Error ...
Apparently This seems to be OK on other than Windows, but an error occurs on Windows.
cd C: \ Users \ (user name) \ Desktop python C:\Python\Python37\Tools\scripts\2to3.py -w hello.py
I got it! !!
The parts you need to change to use
C: \ Users \ (username) \ Desktop code> li>
- Path to 2to3.py
C: \ Python \ Python37 \ Tools \ scripts \ 2to3.py code> li>
- File name of the file you want to convert
hello.py code> li>
Conversion tool from 2 system to 3 system-Python-izm https://www.python-izm.com/tips/2to3/
2to3 --Automatic code conversion from Python 2 to 3 -Python https://docs.python.org/ja/3/library/2to3.html
Recommended Posts