Here’s another one I fully expected to work; replacing PIPE with a regular
file.

import subprocessimport threadingimport tempfile

child = """\
import time

while True:
    time.sleep(1)
    print("child: Still running..")

"""

pipe = tempfile.TemporaryFile()
popen = subprocess.Popen(
    ["c:/python27/python.exe", "-u", "-c", child],
    stdout=pipe
)

My theory was that perhaps Maya has mutilated PIPE for it’s own benefit.
But alas, still hangs..
​

On 22 February 2017 at 17:34, Christopher Crouzet <
[email protected]> wrote:

> It's common when doing multiprocessing to have things working when they
> shouldn't in theory (I remember stumbling on a few such examples on
> StackOverflow, and writing many myself). This can be due to the order in
> which operations are being executed on either processes, the size of the
> inter-process messages, and whatnot. This also makes debugging a pain
> because reproducing some issues can be based on luck. So if I were you, I
> wouldn't put too much weight on different behaviours coming from other
> softwares.
>
>
> On 23 February 2017 at 00:27, Marcus Ottosson <[email protected]>
> wrote:
>
>> That sounds logical, but the theory doesn't hold when considering it
>> works with Python standalone and with Houdini. :(​
>>
>> --
>> 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/ms
>> gid/python_inside_maya/CAFRtmOBX--vbvpOzUDP%2BsiX04MpT-
>> yBMaj6DXwao2sk%3DFz6nPw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOBX--vbvpOzUDP%2BsiX04MpT-yBMaj6DXwao2sk%3DFz6nPw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Christopher Crouzet
> *https://christophercrouzet.com* <https://christophercrouzet.com>
>
> --
> 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/CANuKW51e42hnVhzWTYGMuBy49pRxL
> QWyU6VSK_nQtno1vzUq2Q%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CANuKW51e42hnVhzWTYGMuBy49pRxLQWyU6VSK_nQtno1vzUq2Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*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/CAFRtmODENpMQFw9U7Q7fugFmPsaFWR3jKjMfZas-pXf1saAw3g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to