Discussion:
[Notepad-plus-plus] [notepad-plus - Plugin Development] NppExec run another child process
SourceForge.net
2009-04-22 17:56:53 UTC
Permalink
Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=7262957
By: bkamrani

Hi,
First thanks for nice piece of code!

Second, is it possible to create several child process OR just kill the last
child process(s) and start a new process by an script?

The reason for choosing a child process is that I want to have output from the
process visible (in the Console).

All I want to achieve is to:
- run a Python program and see the output in the console (for debugging purpose),
- next when I want to test the python program again after some eventual changes
are applied, can run it just by pressing one button (for example F6 or another
shortcut). The last process can be still running or just killed though by the
script.

What I currently do is that I have to kill the process manually before I can
start a new child process, but as I mentioned above I want to automate a bit
this process and do all steps by only one key press. But I can't make it.

Here is one of what I have tried so far.

npp_run taskkill /IM pythonw.exe (or cmd.exe)
cmd /k C:\MSC.Software\MD_Adams\R4_beta\python\win32\pythonw.exe -u
$(FULL_CURRENT_PATH)

Greatfull if somebody can help.
Thanks,
/Behnam

______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=482781
SourceForge.net
2009-04-23 09:30:29 UTC
Permalink
Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=7267680
By: dv__

Please read this thread:

http://sourceforge.net/forum/forum.php?thread_id=2371190&forum_id=672146

I guess, you can send an exit message to Python when NppExec asks for it, this
message will finish the current Python process, and the next desired action
will be executed at once.

______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=482781
SourceForge.net
2009-04-24 11:46:28 UTC
Permalink
Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=7275486
By: bkamrani

Hi DV!
Thanks for the thread. It's the same problem. but I coun't figure out the solution
still.

Note that all I need is to somehow sending the Terminate command in the "NppExec
- Warning - Console process is still running" dbox in my running script
or CTRL-C

So the question would be is there any command or shourtcut to Terminate button
or CTRL-C? Something link "Npp_termin" would be perfect!

Thanks in advance!

______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=482781
SourceForge.net
2009-04-25 17:09:31 UTC
Permalink
Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=7284228
By: dv__

If you mean the child process must be terminated automatically (without NppExec's
warning), I have to say it will not be done because it is unsafe. Terminating
the process may cause resources leak or something like that, it is not a normal
way to finish the process. For example, let's take "cmd.exe" - a normal way
to finish it is to type "exit" inside cmd's console. You can start "cmd.exe"
inside NppExec, then try to execute another command or script while cmd is running,
and NppExec will show its window "NppExec - WARNING - Console process is still
running". Now you can type "exit" as 'exit message' in this window and press
'Send' button or just press Enter. The message "exit" will be sent to cmd, and
NppExec's command or script you wanted will be started right after the cmd's
process will be finished as a result of its "exit" message.
If the python's process can be finished with "quit();" or something like that,
you should use this string as the 'exit message'. Once you type it, you will
need just to press Enter next time you see NppExec's warning window.

______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=482781
SourceForge.net
2009-04-27 09:34:02 UTC
Permalink
Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=7296156
By: bkamrani

OK, let's put it in this way.

First I have to start my python command such as:

cmd /c C:\python25\python.exe

Without "cmd /c" I couldn't manage to show the application GUI. Please try this
and try to end the python execution without using CTRL-C. I seem can't communicate
to the cmd windows any longer to close it. If there is a method to do this,
then I think I'll be all set.

All I'd like to achieve is to skip pushing the "Send" or Enter each time I run
to debug.

Side note: you seem already have implemented the Terminate in the dbox even
though you think it is "unsafe" (together with showing a text that it is not
recommended). I think this is all fine. Now creating a Npp_Terminate would do
exactly the same thing or? If the "not recommended" text make it safe, then
you can of course have a similar text beside the command in the help (like unsafe,
use it on your risk or whatever).

PS. There are many unsafe objects in the world which are much worse (drugs,
guns, power, etc) and people use or abuse them with their insight. Having a
terminate command is probably not much more dangerous. :)



______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=482781
SourceForge.net
2009-04-28 10:12:19 UTC
Permalink
Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=7306136
By: dv__

If you need Python's console to input some commands, use NPP_RUN to run Python
in its own console window.
If you want to run some Python's program, you can do it directly in NppExec's
Console:

C:\python25\python.exe my_python_program.py

Both approaches do not need to terminate the Python's process.
Anyway, NPP_TERMINATE will not be implemented. You can implement such command
by yourself, if you want.

______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=482781
SourceForge.net
2009-04-29 10:38:24 UTC
Permalink
Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=7315657
By: bkamrani

Np, I've actually moved to Eclipse for a while as the main DE and fortunately
one can run as many times just by ONE key-press.

But what is the benefit of key-press over the shortcut command?


______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=482781

Loading...