Python scripts stop working with double click on Windows

I always ran my scripts on windows by double-clicking them. However, after I reinstalled my python versions, this does not happen. My python installations are on C:\Python27 and C:\Python33 . PATH has C:\Python27\ . If I try to run the script from cmd, it works fine. But when I double-click any .py file, nothing happens.

I am completely unaware, as I often do not use windows to create scripts. What could be the reason for this?

+4
source share
4 answers

Double-clicking is not associated with PATH , but an association of extensions.

Check the possibility of expanding the register when installing (or restoring) python.

enter image description here

+2
source

Steps to cure this problem

1) Right click on the script.
2) Select properties and then
3) Change the parameter of how to open the script (set it as python).

This will force all of your .py extension scripts to run with double-click in windows enter image description here

+5
source

Removed all python versions and folders. The WinPython-64bit-2.7.5.1 package is installed (as before), and now everything works. I can run my scripts by double-clicking them. Really strange.

+1
source

I had the same problem. The code works in IDLE, but not with a double click. I ran the script through the command line and this gave me an error that IDLE did not find. Windows did not like the ascii characters I typed. I deleted them and the script started working again with a double click.

0
source

Source: https://habr.com/ru/post/1262761/


All Articles