Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python scripts stopped running on double-click in Windows

Tags:

python

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

I am completely clueless as I don't use windows often for scripting. What can be the reason for that?

like image 707
minerals Avatar asked Dec 11 '13 14:12

minerals


4 Answers

Steps to cure this problem

1) Right click on your script.
2) Choose properties and then
3) Change the option how to open your script (set it as python).

This will make all of your .py extension scripts into running on double click in windowsenter image description here

like image 70
Lalit Sachdeva Avatar answered Nov 14 '22 23:11

Lalit Sachdeva


Double-clicking is not related to PATH, but extension association.

Check register extension option when you install(or recover) the python.

enter image description here

like image 20
falsetru Avatar answered Nov 14 '22 21:11

falsetru


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

like image 40
minerals Avatar answered Nov 14 '22 23:11

minerals


I was having the same issue. The code works in the IDLE but not on double click. I ran the script through the command prompt and it gave me an error that the IDLE didn't find. Windows didn't like the ascii characters I was printing. I removed them and the script started to work on double click again.

like image 35
Deepak M Avatar answered Nov 14 '22 23:11

Deepak M