I am using windows 11 and have installed python 2.7 first, and python 3.10 right after. I have set the environment path for both.
I have also made a copy of the python exe and renamed them to "python2" and "python3" (see below)
https://i.imgur.com/oZlL2iS.jpeg
https://i.imgur.com/MBRe9LL.jpeg
In the command prompt when I type "python - - version" it displays the last version of python I installed which is python 3. And when I type "python - 2 - - version" it displays the python 2 version I installed. Everything is working as it's suppose. (see below)
https://i.stack.imgur.com/HB2sQ.png
Now at this point I created two different .py files (contents of files below)
https://i.stack.imgur.com/ABL80.jpg
https://i.stack.imgur.com/8O2op.jpg
The problem I am running into is that when I double click these python files, the command prompt opens and displays python 2.7 on both, even though I have the shebang line to associate with python 3 in one of the files.
In windows 10 which I set up many years ago, I have everything setup exactly the same, except for the python versions (I have python 2.7 and python 3.6). And when I double click the python 2 shebang file, the output is python 2.7, and when I double click the python 3 shebang file, it displays python 3.6.
How can I get this same outcome in windows 11? I'm not quite sure what the problem is.
I initially used the help from the answers given to the same question in windows 10 from many years ago, but these answers aren't working for windows 11. See below