There is a script with an input argument that must be run asynchronously in a separate process (the function to start is presented below). At the moment there is code, however, it works synchronously with the main executing thread and blocks its execution until its completion:
import shlex import subprocess import sys def CreateSubProcess(script, params): command_line = '\"{0}\" \"{1}\" \"{2}\"'.format(sys.executable, script, params) args = shlex.split(command_line) script_process = subprocess.Popen(args, stdout=subprocess.PIPE) out, err = script_process.communicate() exit_code = scriptprocess.returncode How to implement asynchronous script operation in a separate process with the ability to check the viability of the process?