Running Python with Notepad++ on Windows



  • 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).



  • @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.



  • @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.



  • 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.



  • @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.


Log in to reply