Convert python2 to 3 showing syntax error

I wanted to convert python 2 codes to python 3. I came across a tutorial from YouTube (
But when i run the lines, it showing following errors as in the image:

I have the following files:

This is the file I wanted to translate code from python 2 to python 3:

File name:
File location: C:\Users\mvarm\Desktop\Python 2 to 3 translate\

Python 3.6 Location:


Python2to3 File Location:


Hope someone can help me to run the above file correctly without the error.

Thanks in advance.

The problem is you are trying to run a python program from inside the python shell. In the first line of your screenshot you enter the python shell with this:


That’s why the bottom line starts with “>>>”

Notice he closed the powershell window and reopended it at 2:30

You would want to leave the python.exe part out, see 3:50 in the video you linked to: