Try passing the full path to xdg-open, or pass shell=True to Popen. - More on shell here <https://docs.python.org/2/library/subprocess.html#popen-constructor>.
On 21 October 2016 at 20:51, Justin Israel <[email protected]> wrote: > > > 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 > <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0ijGfqQ6juhGpAcgf3ptVbz-Zt3EL9zKQhUxh4ZY6DsQ%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/CAFRtmOD3WsmJGMqxm%2BvH28ZPrTk7kD11tDxpg4Mfu9ajwaD%3DcA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
