Unfortunately I can't give a custom example at this moment,  but you have a
perfectly good stdin pipe that can be used in your subprocess Popen
command. Just google how to use it in the meantime. You can write to stdin
in the parent process and read from it in the child. It would be exactly
like what you originally described with http.The child can block and wait
on stdin until the parent sends something.

On Mon, 9 Mar 2015 11:45 PM Marcus Ottosson <[email protected]> wrote:

> Sorry, that’s:
>
> >>> import subprocess>>> proc = subprocess.Popen(["python"], 
> >>> creationflags=subprocess.CREATE_NEW_CONSOLE)>>> send_signal_somehow(proc)
>
> ​
>
> On 9 March 2015 at 10:44, Marcus Ottosson <[email protected]> wrote:
>
>> Ah, excellent. This is what I’ve been looking for​, I merely used this
>> inverse request thing because I didn’t understand the alternatives well
>> enough.
>>
>> If you own the child process, you can just use a pipe between them to
>> communicate.
>>
>> I’ve seen this mentioned, read about it, attempted it, but never really
>> understood it. Could you provide a small example?
>>
>> Here’s how my situation looks.
>>
>> >>> import subprocess>>> proc = subprocess.Popen(["python"], 
>> >>> creationflags=subprocess.CREATE_NEW_PROCESS)>>> send_signal_somehow(proc)
>>
>> It’ll open up a new interpreter, how can I handle the incoming signal in
>> there, and how do I send it from the parent process?
>>
>> In a certain daemon service I maintain, I use USR1 to signal a specific
>> type of shutdown request as opposed to a SIGTERM.
>>
>> That also sounds viable; in this case, it’s a request for a GUI in an
>> external process to show, which I’d imagine being similar if not identical
>> to a shutdown request.
>> ​
>>
>
>
>
> --
> *Marcus Ottosson*
> [email protected]
>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAavU0BSO%3DBnOWZ1WuJNN5zXZk1WDtOKq8xu1cc%3D%3D9FVg%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAavU0BSO%3DBnOWZ1WuJNN5zXZk1WDtOKq8xu1cc%3D%3D9FVg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA11LHZX5Vfvujxf7cEo_pP%2BCwB3eJi-fScaYg8m_YFxog%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to