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.
For more options, visit https://groups.google.com/d/optout.