I tried using the same as mentioned by you. If my suggestions above don’t work for you, tell us exactly what you tried, and exactly what the behavior is when it didn’t work (copy/paste error messages, don’t just summarize said: The dearth of details makes it really hard for us to actually help you. Depending on what a “shell execute error” is, it might not even be unique to Notepad++ environment, and if you manually ran your script from a cmd.exe window, you might get the same error – in which case, you are asking a “cookie baking” question. We cannot know, because you didn’t bother telling us what you tried, or what exactly the error was. Of course, maybe you’ve tried all of those. Or, when doing compiler-based rather than interpreter-based programming, I can have it save and compile and run, in one fell swoop. Plus, NppExec gives the benefit of being able to do multi-line commands, so I can have it save the current file before running it, just in case I forgot to hit save before running. So instead of using the builtin Notepad++ Run > Run, I install the NppExec plugin, and use Plugins > NppExec > Run, which will open up a console window embedded in Notepad++. I personally like having the results of running my python (or more often, perl) scripts in Notepad++ itself, rather than spawning a new window. If it’s a command you’ll use often, you can hit Save… instead of Run when done in the dialog, and you can save it as a macro, and even assign a keyboard shortcut. py file associated with the correct python.exe already, you can simplify to cmd /k "$(FULL_CURRENT_PATH)" – though if you have spaces in the filename, it might need to be cmd /s /k "$(FULL_CURRENT_PATH)" instead. Alternatively, you could use cmd /k c:\path\to\python.exe "$(FULL_CURRENT_PATH)", which will keep the cmd.exe window open, even after the python is done running. Of course, the external window that pops up will disappear right away, unless your python script happens to end with a statement that waits for user-input. In a pure Notepad++ environment, all you need to do is to use the Run menu’s Run item, enter c:\path\to\python.exe "$(FULL_CURRENT_PATH)". I will use python.exe to refer to whichever of those you want. I assume you mean you want to run a python program using an external python interpreter, like python2.exe or python3.exe. Guide me how to run a python program with notepad++
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |