On my system (Windows Vista Home Premium 64bit) Python files are associated with Python interpreter:

C:\Users\Piotr>assoc .py
C:\Users\Piotr>ftype Python.File
Python.File=c:\python\2.7\python.exe "%1" %*

Nevertheless when I run any Python script from command line a window titled Open With pops up asking me to Choose the program you want to use to open this file.

3 Answers 3


Try Shift+Right Click on a .py file in explorer and selecting "open with..." and then manually selecting the python interpreter.

  • I have a couple of Python installations and I wrote batch files to switch among them. Manual procedure you describe is out of question. Aug 26, 2011 at 6:35
  • 2
    This breaks drag and drop, and argument passing
    – Eric
    Jul 5, 2016 at 2:05

no, Keltari's suggestion should work. there is another checkbox that asks whether to use the settings for all files of this type.

Also, make sure your PATH (system/user environment variable) includes the path to your python executable.


Press right click on one of the codes you already have, and choose the IDE (or whatever else) you want to open the .py file with, and choose to make it the default app to open those files. Hope it helped.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.