Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Spyder to open python scripts (.py files) directly from Windows Explorer

Tags:

I have recently installed the Anaconda distribution on Windows 7 (Anaconda 3-2.4.0-Windows-x86_64). Unlike IDLE, I can't right-click and open a py file in the Spyder IDE. I will have to open Spyder first and then navigate to the file or drag and drop it in the editor. Is there any way to open the file in the editor directly from Widows Explorer?

like image 689
AGandom Avatar asked Nov 20 '15 00:11

AGandom


People also ask

How do I make Spyder default for .py files?

When you get the Open With... dialog, select the "Select a program from a list of installed programs" option. Then make sure the "Always use the selected program to open this kind of file" option is selected. Click "Browse" to point to the Spyder executable.

How do I change the default program to open a .py file?

There's a option in windows for doing this : Just search "Choose default apps by file type" in windows search bar. And choose python (or any suitable program) as default app for . py files.


1 Answers

With the current version of Anaconda (4.1.0) you can simply right-click on a python script in Windows File Explorer and choose "Open with". The first time you do this you need to select "Choose default program" and then browse to spyder.exe in the Script directory in your Anaconda installation. Also make sure that the "Always use the selected program to open this kind of file" is unchecked and then click OK. From now on spyder.exe will always be listed as one of the options when you select "Open with" from the right-click menu in Windows File Explorer.

like image 70
Gustav Delius Avatar answered Oct 15 '22 18:10

Gustav Delius