Thanks Justin and Marcus ... Popen is the way to go for me. Worked great. On Monday, July 28, 2014 3:54:17 PM UTC-4, Justin Israel wrote: > > The subprocess module superseded all of the other various ways of > launching processes, such as os.system, os.popen, commands, etc. > > What you were calling is the convenience call() function that waits for > the return code of the process. So of you don't want to wait for the return > code immediately, you would use subprocess.Popen directly, which gives you > back and object that could wait for the return code, or read stdout or > stderr, or send to stdin. > > Also with Popen, you should be able to just pass all args broken up into a > list and it handles the quoting for you: > > ["cmd", "arg", "-v", "--flag", "quoted with spaces"] > On 29/07/2014 6:12 AM, "md" <acco...@mdonovan.com <javascript:>> wrote: > >> worked great ... why have both ? >> >> On Monday, July 28, 2014 2:05:08 PM UTC-4, Marcus Ottosson wrote: >>> >>> Try subprocess.Popen instead. >>> >>> >>> On 28 July 2014 18:32, md <acco...@mdonovan.com> wrote: >>> >>>> I have a question about calling external programs from inside Maya >>>> using Python. (in this case an image viewer) >>>> >>>> I am trying the following : >>>> >>>> *from subprocess import call* >>>> >>>> and then inside my code using : >>>> >>>> *call([rv_path, "'"+_review_arg+"'"]) * >>>> >>>> The program launches , but its in a modal state for some reason. I >>>> cannot do anything else in Maya until I close the subprocess app. >>>> >>>> I have also tried *os.system(r'"%s"' %my_cmd_line)* with the same >>>> results. >>>> >>>> I must be doing something wrong ? >>>> >>>> Thanks >>>> >>>> M >>>> >>>> -- >>>> 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 python_inside_maya+unsubscr...@googlegroups.com. >>>> To view this discussion on the web visit https://groups.google.com/d/ >>>> msgid/python_inside_maya/e1b0f071-1d1e-4339-a66a- >>>> 4c093911a629%40googlegroups.com >>>> <https://groups.google.com/d/msgid/python_inside_maya/e1b0f071-1d1e-4339-a66a-4c093911a629%40googlegroups.com?utm_medium=email&utm_source=footer> >>>> . >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> >>> >>> -- >>> *Marcus Ottosson* >>> konstr...@gmail.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 python_inside_maya+unsubscr...@googlegroups.com <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/python_inside_maya/ac3787a1-0262-4d5f-86d3-c33ab5bc6eef%40googlegroups.com >> >> <https://groups.google.com/d/msgid/python_inside_maya/ac3787a1-0262-4d5f-86d3-c33ab5bc6eef%40googlegroups.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 python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/082ba124-a1d4-4a46-8757-cc86d413498e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.