How Python creates a new process

Source: Internet
Author: User

The recent maintenance of the Nuke toolkit in the synthesis department found that many tools were used in a personal way, without documentation. This also led to artist in the use of tools when the more sensitive, adjust the parameters when the lack of logic, in the long-time, artist will produce this consciousness: just the last call to effect OK on the line, as to how to tune, is a personal matter. Even a lot of artist will reject this kind of toolkit, and think that it is not only difficult to use, but also not obvious.

There is no doubt that any tool will be more effective when it is fully mastered, thinking it through, and decide to write a document for each tool.

After writing, the document can be opened in menu.py through the Os.system (path) method.

But the problem arises. This document is opened with Word will occupy the nuke process, causing nuke into suspended animation state. Only turn off word to dismiss nuke suspended animation.

In other words, word and nuke are actually sharing the same process, which is obviously unacceptable. A script was written to open a new process for the newly opened Word program.

The code blocks are as follows:

Import Threading:
def threading_document (path):
Thread = Threading. Thread (target = Os.system,args = (path,))
Thread.setdaemon (True)
Thread.Start ()

With this function, you can avoid the bug of sharing a process.

How Python creates a new process

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.