CoCalc Public Filescount_up_every_5_seconds.ipynbOpen with one click!
Author: Tim Clemans
Views : 56
License: Apache License 2.0
Compute Environment: Ubuntu 20.04 (Default)
In [4]:
import threading from IPython.display import display, HTML import ipywidgets as widgets import time def thread_func(out): i = 0 while True: out.clear_output() out.append_stdout('{}\n'.format(i)) i += 1 time.sleep(1) out = widgets.Output() thread = threading.Thread( target=thread_func, args=(out,)) thread.start() display(out)
In [3]:
print('hi')
hi
In [ ]: