I have installed python 2 after installing python 3.And now when I executing my python file by clicking on file (not by cmd) its run python 2 ,but I want python 3.
I have tried script:
If the current default windows application for
.py files is currently
C:\python27\python.exe) and not the new
py.exe launcher, you can just change the default windows application for the file type. Right-click on file -> properties -> click the change button for default application and change it to the python3 executable.
If the default application for the file is the
py.exe windows launcher, you can add a shebang line in your scripts to force the python executable and the launcher should respect it. Add this as the first line of your file
If you're python3 installation path is different, make sure to use that instead.