On Sat, Oct 22, 2016 at 8:12 AM <[email protected]> wrote:

> Hello,
>
> Anyone know how to use subprocess inside Maya ?
> When i'm trying this code inside maya:
>
> import subprocess
>
> dirName = '/u/Users/TEST/'
> xdg = subprocess.Popen(['xdg-open', dirName], stdout=subprocess.PIPE,
> stdin=subprocess.PIPE, stderr=subprocess.PIPE)
>

Do you check the stdout/stderr and the return code after this? Make sure to
read the output via communicate() if you are creating pipes.
Also, you don't need a pipe for stdin unless you actually intend to send
data to the stdin of the process.


>
> It does nothing, but when I execute this code in a Linux script command it
> works.
>
> --
> 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/39257500-24ee-4366-b8b8-e30ce5acc5a6%40googlegroups.com
> .
> 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/CAPGFgA0ijGfqQ6juhGpAcgf3ptVbz-Zt3EL9zKQhUxh4ZY6DsQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to