Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm learning python on x64 windows 7 machine. But after installing and uninstalling python 2.7 and 3.2 a few times too many (i just found out 3.x doesn't support some of the 3rd party libraries like PIL), i have lost .py file association(when i double click my python scripts, windows asks me to choose a program to open it with instead of making python interpret it). How can i fix the issue?

share|improve this question

migrated from Sep 23 '12 at 22:11

This question came from our site for professional and enthusiast programmers.

This is not a programming question. Fixing this is done the same way you'd fix it any other time you had it. – kindall Sep 23 '12 at 17:45
"you'd fix it any other time you had it"?? – user1470033 Sep 23 '12 at 18:06
double-click again, lead Windows to pythonw.exe, and check the option that tells Windows to use it for all future .py files as well. – alexis Sep 23 '12 at 18:39
Possible duplicate of Association of Python files in Windows not working – Ƭᴇcʜιᴇ007 Feb 3 at 20:53
up vote 1 down vote accepted

considering you've already set the path in environment variables:

open command prompt:

cd to the directory which contains and then type:

python and hit enter.

or using IDLE:

start IDLE --> press CTRL+O --> open your file --> press F5

share|improve this answer
why the downvote? – Ashwini Chaudhary Sep 23 '12 at 18:42
You got downvoted because you did not answer the question of "how do I fix my file associations" but instead answered "how do I run my python file". – Guvante Feb 16 at 18:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.