list_threads()#

List the names of all of the currently running threads.

Examples#

 1def thread1():
 2    py5.println('thread 1')
 3
 4
 5def thread2():
 6    py5.println('thread 2')
 7
 8
 9def setup():
10    py5.frame_rate(10)
11    py5.launch_repeating_thread(thread1, name='thread 1', time_delay=1.2)
12    py5.launch_repeating_thread(thread2, name='thread 2', time_delay=1.8)
13
14
15def draw():
16    py5.println('running threads:', ', '.join(py5.list_threads()))
17    if py5.frame_count == 50:
18        py5.stop_all_threads()

Description#

List the names of all of the currently running threads. The names of previously launched threads that have exited will be removed from the list.

Syntax#

list_threads() -> None

Updated on September 11, 2021 16:51:34pm UTC