Running Python with Notepad++ on Windows
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)
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).
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)
cmd /kwill make the new command window stay open, so you can see the results of the output.
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.
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.