My code creates a long-running thread in the background and I'd like to have all the output of the thread go to a single cell. Currently just the first message goes to the cell. Demo code:
python
from threading import Thread
import time
def long_running():
print("Thread starting:")
i = 0
while True:
print(f"Loop {i}...")
i += 1
time.sleep(1)
print("Thread exiting.")
t = Thread(target=long_running)
t.start()
Is there any way to capture the output from my thread in a specific cell?
(side note: this code also seems to cause auto export to raise an exception)