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

后端 未结 8 537
無奈伤痛
無奈伤痛 2020-12-29 07:10

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

8条回答
  •  长情又很酷
    2020-12-29 07:28

    The solution from JoeB152 worked perfectly for me!

    If you are interested in adding the spyder icon (or any other) to the .py-files and if you would like to avoid the cmd-pop-up, I found out the following workaround which is feasible without admin rights:

    1. Download the portable version of Bat To Exe Converter (I used v3.0.10).
    2. Open your custom .bat-file in the Bat to Exe Converter.
    3. In the options settings, activate "Icon" and give the path to the respective icon (for me it's in: .../AppData/Local/Continuum/anaconda3/Scripts/spyder.ico).
    4. Set Exe-Format to Invisible (no empty cmd window would pop up anymore)
    5. Convert your .bat-file to an .exe-file.
    6. As usual, set to open .py-files with the newly created .exe.

    Enjoy!

    Environment: Windows 10, Conda 4.8.2, Spyder 4.0.1, Python 3.7

提交回复
热议问题