ok, will look into these ideas..thanks all On Tue, Sep 1, 2015 at 1:07 PM, Justin Israel <[email protected]> wrote:
> They could still be run through subprocess if you package your functions > into a proper main application. And then you just run it with arguments > that control which service(s) will be performed. A benefit is that it is > easy to stop them by killing a process id. The downside is if you need to > actually talk to them actively, it is more complicated than threads. > With threads, to get them to stop before their own action chooses to end, > you have to build in cancellation to the function you run, like having them > check a stop condition. > > On Wed, 2 Sep 2015 6:45 AM Emre Yilmaz <[email protected]> wrote: > >> Yeah, good point. Didn't catch that those system / pipeline cmds were >> themselves also python. >> >> >> On Tuesday, September 1, 2015, Marcus Ottosson <[email protected]> >> wrote: >> >>> Subprocess is really only good for external processes, and less so for >>> Python functions. >>> >>> Threading to the rescue! >>> >>> import timeimport threading >>> def my_system_function(): >>> print("Doing something for 5 seconds..") >>> time.sleep(5) >>> print("Done!") >>> >>> threading.Thread(target=my_system_function).start() >>> >>> >>> >>> On 1 September 2015 at 18:57, Todd Widup <[email protected]> wrote: >>> >>>> I have several functions that run on the system from within >>>> Maya..creating directories, checking things in and out of our source >>>> control system,etc >>>> >>>> I know I read this someplace but I cant recall how to do it..how can I >>>> run those functions from within Maya, but not lock Maya up during that >>>> time. >>>> >>>> thanks >>>> -todd >>>> >>>> -- >>>> Todd Widup >>>> Creature TD / Technical Artist >>>> [email protected] >>>> [email protected] >>>> www.toddwidup.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/CABBPk35MGR64r2sOEDXAdFh-oCwYBV2frAHo89VX%3DiJZFPJcfA%40mail.gmail.com >>>> <https://groups.google.com/d/msgid/python_inside_maya/CABBPk35MGR64r2sOEDXAdFh-oCwYBV2frAHo89VX%3DiJZFPJcfA%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/CAFRtmOCO1rDSXGNVhOTfen8fTheY68yLQEM9dRTO_%3DVxstG7BA%40mail.gmail.com >>> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCO1rDSXGNVhOTfen8fTheY68yLQEM9dRTO_%3DVxstG7BA%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/CA%2Bhu4Mzk6J0NDms8fK0PmPsRf0PKmj_yjN1jYfOzY_YV7Z6g5g%40mail.gmail.com >> <https://groups.google.com/d/msgid/python_inside_maya/CA%2Bhu4Mzk6J0NDms8fK0PmPsRf0PKmj_yjN1jYfOzY_YV7Z6g5g%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/CAPGFgA3ZuUzXY%2BzJGY22DL1Huhb6%2BOYnRC3ArSN9OxksSjeD0g%40mail.gmail.com > <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3ZuUzXY%2BzJGY22DL1Huhb6%2BOYnRC3ArSN9OxksSjeD0g%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- Todd Widup Creature TD / Technical Artist [email protected] [email protected] www.toddwidup.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/CABBPk361dup8Sc7xWFzo2NFtHKTaMRvaWgk4joWZ1iCj6csveA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
