Hi,
I'm trying to start an external command line program from within houdini session but without blocking the Main thread. How can I achieve that in Python? Thanks.
Kuba
Run external program in a separate thread
2835 2 1- kuba
- Member
- 345 posts
- Joined:
- Offline
- ManDay
- Member
- 40 posts
- Joined: May 2010
- Offline
- kuba
- Member
- 345 posts
- Joined:
- Offline
Thanks, it took a while but fortunately sort it out. It is not definitely the most elegant solution, so I appreciate any inspiring alternatives.
Here is the code if anyone interested:
def mainThr():
import time, thread, subprocess
def thr():
i=0
while i < 10:
print i
time.sleep(1)
i=i+1
#a = thread.start_new_thread(thr,())
#thr()
import threading
thread1 = threading.Thread( target=thr, args“”) )
thread1.start()
(Btw. I use this as a funtion for the HDA button)
Here is the code if anyone interested:
def mainThr():
import time, thread, subprocess
def thr():
i=0
while i < 10:
print i
time.sleep(1)
i=i+1
#a = thread.start_new_thread(thr,())
#thr()
import threading
thread1 = threading.Thread( target=thr, args“”) )
thread1.start()
(Btw. I use this as a funtion for the HDA button)
-
- Quick Links