5

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?

1

4 Answers 4

5

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

Sign up to request clarification or add additional context in comments.

3 Comments

then what happens when you double click on your script. does it open in any Text Editor. or what happen when you double click.
nothing happens, I can see a blue circle for a sec and then nothing.
This could be because you are not trying to print any thing on the python shell. so, it would be better if you paste your code here so we can check it and as you are saying it is processing your code that's why it showing blue circle(which is a sign of processing)!
3

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

1 Comment

this is what I did initially, I reinstalled it now again. No changes. I double-click the file and nothing happens.
2

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.

Comments

1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.