I had a similar problem with other software that I use.
My way around this problem is to set the .py file association to C:\Anaconda\Scripts\spider-script.py through the Open With dialog box. If you now try to open your File.py double-clicking, you will get an error message like
~ \ file.py is not a valid Win32 application.
This can be solved by editing the spyder-script.py registry spyder-script.py :
HKEY_USERS\S-1-5-21-3559708500-1520960832-86631148-1002\Software\Classes\Applications\spyder-script.py\shell\open\command
and replacing the default value "C:\Anaconda\Scripts\spyder-script.py" %1 with "C:\Anaconda\python.exe" "C:\Anaconda\Scripts\spyder-script.py" %1 . Use the search function for this key if the path does not match for your computer, and of course, use the appropriate path for your Python installation. spyder-script.py should now run in the Python shell.
From the document line ftype,
... In the open command line,% 0 or% 1 are replaced with the name of the file that is launched through the association.
source share