How to properly close a process with NppExec?
- by Sam the Great
I'm not sure what's going on here, but the following code continues running even after I end the process in the NppExec console with Ctrl-C (during the execution of the while loop). I restarted my computer to stop the Ctrl key sends. However, if I run the script in Window's cmd prompt, Ctrl-C ends the script just fine.
import time
import win32com.client
shell = win32com.client.Dispatch("WScript.Shell")
time.sleep(2)
while True:
shell.SendKeys('^') # Ctrl key
time.sleep(0.5)
The NppExec run command I used was: cmd /C python -u "$(FULL_CURRENT_PATH)"
Let me know if there is any more information I can provide. Thanks.