How to capture the output of backend thread in jupyter_client

9 views
Skip to first unread message

Jeff Zhang

unread,
Aug 12, 2017, 8:16:53 AM8/12/17
to Project Jupyter
I use jupyter_client to execute a piece of code and get its output.  It works for most of the cases, but doens't work when my code has a backend thread.  e.g. the following code start a thread, but I could not get the output via jupyter_client. Does anyone know how can I get the output of this case ? Thanks


import time
from threading import Thread


def worker():
   
for i in range(3):
        time
.sleep(1)
       
print(i)
       
t
= Thread(target=worker)
t
.start()

Reply all
Reply to author
Forward
0 new messages