How do I make all .py files launch with Spyder?











up vote
2
down vote

favorite
1












I installed Spyder using Anaconda, and I am able to launch the IDE using the Spyder icon in my start menu (Win10). I wanted to set my preferences to open all .py files with Spyder, so I followed the Spyder start menu button to an executable, pythonw.exe. The problem is that I cannot launch pythonw.exe by clicking it.



How does the start menu icon for Spyder, which points to pythonw.exe, launch Spyder, but clicking the executable does not yield the same results? Also, when I double click spyder.exe in AnacondaScripts a command prompt opens along with the IDE, which does not happen when I click the start menu icon.



Why does this application behave so much differently than any other application I've used before (if this is just how things are in python, I apologize as I'm new!) and is it possible to set Spyder as the default application to open .py files in the same way I can open source files with IDEs in other languages?



Cheers










share|improve this question
























  • you can try open with and select spyder, it is working for me, but it will take some time to initialize the spyder IDE.
    – pyd
    Feb 12 at 4:30










  • This results in the extra blank console window being opened when Spyder launches, and closing the console window closes Spyder. Opening Spyder via the start menu does not cause this console window to open. Any idea what's causing this?
    – shtuken
    Feb 12 at 6:03















up vote
2
down vote

favorite
1












I installed Spyder using Anaconda, and I am able to launch the IDE using the Spyder icon in my start menu (Win10). I wanted to set my preferences to open all .py files with Spyder, so I followed the Spyder start menu button to an executable, pythonw.exe. The problem is that I cannot launch pythonw.exe by clicking it.



How does the start menu icon for Spyder, which points to pythonw.exe, launch Spyder, but clicking the executable does not yield the same results? Also, when I double click spyder.exe in AnacondaScripts a command prompt opens along with the IDE, which does not happen when I click the start menu icon.



Why does this application behave so much differently than any other application I've used before (if this is just how things are in python, I apologize as I'm new!) and is it possible to set Spyder as the default application to open .py files in the same way I can open source files with IDEs in other languages?



Cheers










share|improve this question
























  • you can try open with and select spyder, it is working for me, but it will take some time to initialize the spyder IDE.
    – pyd
    Feb 12 at 4:30










  • This results in the extra blank console window being opened when Spyder launches, and closing the console window closes Spyder. Opening Spyder via the start menu does not cause this console window to open. Any idea what's causing this?
    – shtuken
    Feb 12 at 6:03













up vote
2
down vote

favorite
1









up vote
2
down vote

favorite
1






1





I installed Spyder using Anaconda, and I am able to launch the IDE using the Spyder icon in my start menu (Win10). I wanted to set my preferences to open all .py files with Spyder, so I followed the Spyder start menu button to an executable, pythonw.exe. The problem is that I cannot launch pythonw.exe by clicking it.



How does the start menu icon for Spyder, which points to pythonw.exe, launch Spyder, but clicking the executable does not yield the same results? Also, when I double click spyder.exe in AnacondaScripts a command prompt opens along with the IDE, which does not happen when I click the start menu icon.



Why does this application behave so much differently than any other application I've used before (if this is just how things are in python, I apologize as I'm new!) and is it possible to set Spyder as the default application to open .py files in the same way I can open source files with IDEs in other languages?



Cheers










share|improve this question















I installed Spyder using Anaconda, and I am able to launch the IDE using the Spyder icon in my start menu (Win10). I wanted to set my preferences to open all .py files with Spyder, so I followed the Spyder start menu button to an executable, pythonw.exe. The problem is that I cannot launch pythonw.exe by clicking it.



How does the start menu icon for Spyder, which points to pythonw.exe, launch Spyder, but clicking the executable does not yield the same results? Also, when I double click spyder.exe in AnacondaScripts a command prompt opens along with the IDE, which does not happen when I click the start menu icon.



Why does this application behave so much differently than any other application I've used before (if this is just how things are in python, I apologize as I'm new!) and is it possible to set Spyder as the default application to open .py files in the same way I can open source files with IDEs in other languages?



Cheers







python anaconda spyder






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 27 at 0:03









T.Fung

426




426










asked Feb 12 at 4:24









shtuken

666




666












  • you can try open with and select spyder, it is working for me, but it will take some time to initialize the spyder IDE.
    – pyd
    Feb 12 at 4:30










  • This results in the extra blank console window being opened when Spyder launches, and closing the console window closes Spyder. Opening Spyder via the start menu does not cause this console window to open. Any idea what's causing this?
    – shtuken
    Feb 12 at 6:03


















  • you can try open with and select spyder, it is working for me, but it will take some time to initialize the spyder IDE.
    – pyd
    Feb 12 at 4:30










  • This results in the extra blank console window being opened when Spyder launches, and closing the console window closes Spyder. Opening Spyder via the start menu does not cause this console window to open. Any idea what's causing this?
    – shtuken
    Feb 12 at 6:03
















you can try open with and select spyder, it is working for me, but it will take some time to initialize the spyder IDE.
– pyd
Feb 12 at 4:30




you can try open with and select spyder, it is working for me, but it will take some time to initialize the spyder IDE.
– pyd
Feb 12 at 4:30












This results in the extra blank console window being opened when Spyder launches, and closing the console window closes Spyder. Opening Spyder via the start menu does not cause this console window to open. Any idea what's causing this?
– shtuken
Feb 12 at 6:03




This results in the extra blank console window being opened when Spyder launches, and closing the console window closes Spyder. Opening Spyder via the start menu does not cause this console window to open. Any idea what's causing this?
– shtuken
Feb 12 at 6:03












2 Answers
2






active

oldest

votes

















up vote
1
down vote



accepted










You can right click any of your *.py file, go to properties and choose Spyder as "Opens with" choice.






share|improve this answer





















  • I guess this answers the question in the title but it isn't a perfect fix because it causes an additional cmd window to open along with the IDE. Also I still have no idea how the start menu icon operates.
    – shtuken
    Feb 12 at 23:33


















up vote
2
down vote













I found the answer in this question, answer by xyzjayne.



You create a bat file with the following contents:




start YOURPATHAnaconda2pythonw.exe YOURPATHAnaconda2cwp.py YOURPATHAnaconda2 "YOURPATH/Anaconda2/pythonw.exe" "YOURPATH/Anaconda2/Scripts/spyder-script.py" %1




YOURPATH will be the path leading to the folder just above the Anaconda folder. For me it was:



C:ProgramData



And you select the Choose default program to open this file... - and you choose that bat file.



When you go to Spyder shortcut's properties, the target includes a few files. So my guess is that for Spyder to run, all of these files must be run, and that's why when you just point .py files to one exe it doesn't work.






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f48739521%2fhow-do-i-make-all-py-files-launch-with-spyder%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote



    accepted










    You can right click any of your *.py file, go to properties and choose Spyder as "Opens with" choice.






    share|improve this answer





















    • I guess this answers the question in the title but it isn't a perfect fix because it causes an additional cmd window to open along with the IDE. Also I still have no idea how the start menu icon operates.
      – shtuken
      Feb 12 at 23:33















    up vote
    1
    down vote



    accepted










    You can right click any of your *.py file, go to properties and choose Spyder as "Opens with" choice.






    share|improve this answer





















    • I guess this answers the question in the title but it isn't a perfect fix because it causes an additional cmd window to open along with the IDE. Also I still have no idea how the start menu icon operates.
      – shtuken
      Feb 12 at 23:33













    up vote
    1
    down vote



    accepted







    up vote
    1
    down vote



    accepted






    You can right click any of your *.py file, go to properties and choose Spyder as "Opens with" choice.






    share|improve this answer












    You can right click any of your *.py file, go to properties and choose Spyder as "Opens with" choice.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Feb 12 at 4:54









    Yilun Zhang

    2,80811331




    2,80811331












    • I guess this answers the question in the title but it isn't a perfect fix because it causes an additional cmd window to open along with the IDE. Also I still have no idea how the start menu icon operates.
      – shtuken
      Feb 12 at 23:33


















    • I guess this answers the question in the title but it isn't a perfect fix because it causes an additional cmd window to open along with the IDE. Also I still have no idea how the start menu icon operates.
      – shtuken
      Feb 12 at 23:33
















    I guess this answers the question in the title but it isn't a perfect fix because it causes an additional cmd window to open along with the IDE. Also I still have no idea how the start menu icon operates.
    – shtuken
    Feb 12 at 23:33




    I guess this answers the question in the title but it isn't a perfect fix because it causes an additional cmd window to open along with the IDE. Also I still have no idea how the start menu icon operates.
    – shtuken
    Feb 12 at 23:33












    up vote
    2
    down vote













    I found the answer in this question, answer by xyzjayne.



    You create a bat file with the following contents:




    start YOURPATHAnaconda2pythonw.exe YOURPATHAnaconda2cwp.py YOURPATHAnaconda2 "YOURPATH/Anaconda2/pythonw.exe" "YOURPATH/Anaconda2/Scripts/spyder-script.py" %1




    YOURPATH will be the path leading to the folder just above the Anaconda folder. For me it was:



    C:ProgramData



    And you select the Choose default program to open this file... - and you choose that bat file.



    When you go to Spyder shortcut's properties, the target includes a few files. So my guess is that for Spyder to run, all of these files must be run, and that's why when you just point .py files to one exe it doesn't work.






    share|improve this answer

























      up vote
      2
      down vote













      I found the answer in this question, answer by xyzjayne.



      You create a bat file with the following contents:




      start YOURPATHAnaconda2pythonw.exe YOURPATHAnaconda2cwp.py YOURPATHAnaconda2 "YOURPATH/Anaconda2/pythonw.exe" "YOURPATH/Anaconda2/Scripts/spyder-script.py" %1




      YOURPATH will be the path leading to the folder just above the Anaconda folder. For me it was:



      C:ProgramData



      And you select the Choose default program to open this file... - and you choose that bat file.



      When you go to Spyder shortcut's properties, the target includes a few files. So my guess is that for Spyder to run, all of these files must be run, and that's why when you just point .py files to one exe it doesn't work.






      share|improve this answer























        up vote
        2
        down vote










        up vote
        2
        down vote









        I found the answer in this question, answer by xyzjayne.



        You create a bat file with the following contents:




        start YOURPATHAnaconda2pythonw.exe YOURPATHAnaconda2cwp.py YOURPATHAnaconda2 "YOURPATH/Anaconda2/pythonw.exe" "YOURPATH/Anaconda2/Scripts/spyder-script.py" %1




        YOURPATH will be the path leading to the folder just above the Anaconda folder. For me it was:



        C:ProgramData



        And you select the Choose default program to open this file... - and you choose that bat file.



        When you go to Spyder shortcut's properties, the target includes a few files. So my guess is that for Spyder to run, all of these files must be run, and that's why when you just point .py files to one exe it doesn't work.






        share|improve this answer












        I found the answer in this question, answer by xyzjayne.



        You create a bat file with the following contents:




        start YOURPATHAnaconda2pythonw.exe YOURPATHAnaconda2cwp.py YOURPATHAnaconda2 "YOURPATH/Anaconda2/pythonw.exe" "YOURPATH/Anaconda2/Scripts/spyder-script.py" %1




        YOURPATH will be the path leading to the folder just above the Anaconda folder. For me it was:



        C:ProgramData



        And you select the Choose default program to open this file... - and you choose that bat file.



        When you go to Spyder shortcut's properties, the target includes a few files. So my guess is that for Spyder to run, all of these files must be run, and that's why when you just point .py files to one exe it doesn't work.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 22 at 16:15









        Scruffy

        415




        415






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f48739521%2fhow-do-i-make-all-py-files-launch-with-spyder%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            What visual should I use to simply compare current year value vs last year in Power BI desktop

            Alexandru Averescu

            Trompette piccolo