0

I've made a bunch of tweaks to NPP following this guide, and so far it's gone over well.

But I have a somewhat annoying problem. I want to use input commands in my code.

If the console is closed, this isn't a problem—it pops up and I can type right away in the input field just fine, no clicking.

But when I edit the code and re-run the script (without closing the console), the console clears and runs the program, but I have to click over to be able to interact.

I don't want to close the NppExec console every time I finish the script.

I don't want to have to click over on the console every time I run the script.

As a bonus, I don't want to have to kill my script every time I run it again, either.

I just want to run, type required inputs, go back to editing, re-run, type, etc. without interruptions, if possible..

Can anyone help me with this?

Thank you....

Dan Mašek
  • 17,852
  • 6
  • 57
  • 85
ninthtale
  • 3
  • 3

1 Answers1

0

Please check the NppExec Manual for NppExec ver. 0.6 RC2. It includes a lovely script in the section "4.6.4. Running Python & wxPython":

npp_console -  // disable any output to the Console
npp_save  // save current file (a .py file is expected)
cd "$(CURRENT_DIRECTORY)"  // use the current file's dir
set local @exit_cmd_silent = exit()  // allows to exit Python automatically
set local PATH_0 = $(SYS.PATH)  // current value of %PATH%
env_set PATH = $(SYS.PATH);C:\Python27  // use Python 2.7
npp_setfocus con  // set the focus to the Console
npp_console +  // enable output to the Console
python -i -u "$(FILE_NAME)"  // run Python's program interactively
npp_console -  // disable any output to the Console
env_set PATH = $(PATH_0)  // restore the value of %PATH%
npp_console +  // enable output to the Console

The command

npp_setfocus con

looks like the one you are looking for.

DVV
  • 204
  • 2
  • 5