Community
    • Login

    Running Python with Notepad++ on Windows

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 2 Posters 4.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Dan BrownswordD
      Dan Brownsword
      last edited by

      Hello,

      I am new to using Notepad++ and I am having problems when setting up the destination of Python that will be run. I am trying to run this simple script (already saved as a .py file). Under “run,” I have selected the program to run as the following:

      Program to run: C:\Users\brown\anaconda3\pkgs\python-3.8.8-hdbf39b2_5\python.exe $(FULL_CURRENT_PATH)

      e4a24d40-75b6-480e-8dbc-fe806d92ec5c-image.png

      This is the location of python.exe inside of the Anaconda package I installed it from. When I click on run, a black command prompt window opens for a split second and then nothing happens. What am I doing wrong?

      I appreciate any help (I assume this is very much a beginner error so I apologize).

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @Dan Brownsword
        last edited by

        @Dan-Brownsword ,

        You can prefix the command with cmd /k, so RUN = cmd /k C:\Users\brown\anaconda3\pkgs\python-3.8.8-hdbf39b2_5\python.exe $(FULL_CURRENT_PATH)

        The cmd /k will make the new command window stay open, so you can see the results of the output.

        PeterJonesP 1 Reply Last reply Reply Quote 0
        • PeterJonesP
          PeterJones @PeterJones
          last edited by

          @Dan-Brownsword ,

          Oops, your python file path looks like it has spaces. Try RUN = cmd /k C:\Users\brown\anaconda3\pkgs\python-3.8.8-hdbf39b2_5\python.exe "$(FULL_CURRENT_PATH)"
          – the quotes make it so that the spaces are treated as part of the file name, rather than as argument separators.

          1 Reply Last reply Reply Quote 3
          • Dan BrownswordD
            Dan Brownsword
            last edited by

            Thanks, your fixes helped. Is there a way so that I can always get the code output from an Anaconda Prompt rather than the default Windows Command Prompt?

            Currently it is running from Windows cmd, which might not have all of the installed modules I would like to work with.

            PeterJonesP 1 Reply Last reply Reply Quote 0
            • PeterJonesP
              PeterJones @Dan Brownsword
              last edited by

              @Dan-Brownsword said in Running Python with Notepad++ on Windows:

              output from an Anaconda Prompt

              Sorry, I don’t know Anaconda, so I don’t know how to issue a command to launch a specific script with a specific python inside the Anaconda shell. Whatever the command-line syntax is for that, you would run that command line from the RUN menu, making sure to put the quotes around any paths that might have spaces in the path name.

              1 Reply Last reply Reply Quote 1
              • First post
                Last post
              The Community of users of the Notepad++ text editor.
              Powered by NodeBB | Contributors