How do I programmatically associate a file with a specific "opens with" action? That is, I am creating filename.py on a Windows computer, putting it on the desktop. I want double-clicking it to run the python intrepreter, rather than opening the text editor.
I can do this with the Properties window, but I want to do this automatically, when I create it (from another python program).
I do not want to set up a universal file extension, because I want double-clicking on .py files to result in bringing up the editor, not running the program. It is only for this particular file that I want that behavior. I can do this from the Windows GUI; I want to know how to do it programmatically.
There is no installer. The Python .py program is being created from another python program. It is being created directly in the file system with a open("filename.py").write(file_contents).
The environment is Windows 7
.pyextension open the python interpreter? - rst-2cv