sugarret.blogg.se

Notepad++ python run
Notepad++ python run










  1. #NOTEPAD++ PYTHON RUN INSTALL#
  2. #NOTEPAD++ PYTHON RUN WINDOWS#

Most common option found online is using builtin option Run. I also wanted to run python files directly from Notepad++. I don't know where or how you do this, but in trying various things here, I was able to do that-I don't recall which attempt did the trick. Somewhere I think you have to tell NPP where the Python.exe file is (e.g., for me: C:\Python33\python.exe).

  • The Shortcut dialogue box opens fill it out if you want a keyboard shortcut (there's a note saying "This will disable the accelerator" whatever that is, so maybe you don't want to use the keyboard shortcut, though it probably doesn't hurt to assign one when you don't need an accelerator).
  • The /K is optional, it keeps open the window created when the script runs, if you want that. dialog box, in the field The Program to Run, delete any existing text and type in: cmd /K "$(FULL_CURRENT_PATH)" I eventually got the cmd /k version to work. I wish people here would post steps instead of just overall concepts. So at the end, cmd runs python.exe which executes the current file and keeps the window opened, pause waits for you to press any key, and exit finally close the window once you press that any key. " and waits for any key (that output can be suppressed if need). Pause - prints "Press any key to continue.

    #NOTEPAD++ PYTHON RUN WINDOWS#

    & is unconditional execution of the next command in Windows - unconditional as it runs regardless of the RC of the previous command ( & is "and" - run only if the previous completed successfully, || - is "or").

    notepad++ python run

    #NOTEPAD++ PYTHON RUN INSTALL#

    If that is too much typing for your liking (for me it sure is :), the Run command to use is cmd /k C:\Python27\python.exe "$(FULL_CURRENT_PATH)" & pause & exitĬ:\Python27\python.exe - obviously the full path to your python install (or just python if you want to go with the first executable in your user's path). Yet in cmd /k you have to type exit to close it, in the python -i - quit(). All the answers for the Run->Run menu option go with the "/K" switch of cmd, so the terminal stays open, or "-i" for python.exe so python forces interactive mode - both to preserve the output for you to observe.












    Notepad++ python run