Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a function where I am invoking multiple python scripts with each being invoked with os.system call.

def fun():
    os.system('python '+_path+'\\abc.py '+_arg1+' '+_arg2)
    os.system('python '+_path+'\\xyz.py '+_arg1+' '+_arg2)
    os.system('python '+_path+'\\123.py '+_arg1+' '+_arg2)
    os.system('python '+_path+'\\xxx.py '+_arg1+' '+_arg2)


I want these os.system calls to run in thread mode. Currently it is in sequential mode. Is there any way it can be made in multi-threaded mode?

What I have tried:

function fun() is running in multi-threading mode by getting called from another function. But I did not find a way to make os.system multi-threaded.
Posted
Updated 20-Apr-16 23:46pm

1 solution

 
Share this answer
 
Comments
ashu2188 22-Apr-16 1:15am    
Thanks @CPallini. I used it and feel I am getting some success. I am stuck at how do I figure out if subprocess is still running or not? I noticed Subprocess always returns 'None' as returncode even though it has finished. Any idea?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900