On 6/7/07, Alexey Maksimov &lt;<a href="mailto:alexey.maksimov@gmail.com">alexey.maksimov@gmail.com</a>&gt; wrote:<br>&gt; Hi,<br>&gt; <br>&gt; Please help me with the following:<br>&gt; <br>&gt; I want to write a simple app that should remotely control
<br>&gt; long running shell process. I have a C++ program that does some network<br>&gt; capturing I need. I want to create a simple web interface that can<br>&gt; start and stop this program via shell on linux.<br>&gt; <br>
&gt; I already wrote a web part of this but failed to spawn my process.<br>&gt; I think my problem is that I want to use myserver.tac and don&#39;t want<br>&gt; directly call reactor.run() as shown in documentation.<br>&gt; How can I spawn my long-running process without using 
reactor.run()?<br>&gt; <br>&gt; Thanks in advance,<br>&gt; Alexey.<br>&gt; <br>&gt; _______________________________________________<br>&gt; Twisted-Python mailing list<br>&gt; <a href="mailto:Twisted-Python@twistedmatrix.com">
Twisted-Python@twistedmatrix.com</a><br>&gt; <a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br><br>I&#39;m not sure I understand your problem, but here&#39;s what I think you should do:
<br><br>Write a twisted application (maybe this is your myserver.tac?) which is a simple web server.&nbsp;&nbsp;An easy way to write a twisted web app is with nevow.&nbsp;&nbsp;Since this is a twisted application, assuming your myserver.tac file defines an object named &quot;application&quot;, just run it with:
<br><br>&nbsp;&nbsp; twistd -noy myserver.tac<br><br>The twistd program will automatically call reactor.run() for you, you normally do not need to call it explicitly.<br><br>Now, to launch another process from twisted there are several API&#39;s you can use.&nbsp;&nbsp;
<a href="http://twistedmatrix.com/projects/core/documentation/howto/process.html">This page</a> in the docs explains the most general way, where you have complete control over the inputs and outputs to the spawned program.&nbsp; There&#39;s also a simplified API for launching programs, but it just grabs your process&#39;s output:&nbsp; 
twisted.internet.utils.getProcessOutput().<br><br>Cheers,<br>Christian<br><br>