Python 3.4 - Threading

The threading module allows your program to run two separate functions at once. This can be advantageous and/ or problematic depending on what you want your program to do.

https://www.tutorialspoint.com/python/python_multithreading.htm


import threading

class Matt(threading.Thread):
    def run(self):
        for _ in range(10):
            print(threading.currentThread().getName())

messenger1 = Matt(name= 'send messeages')
messenger2 = Matt(name= 'recieve messages')

messenger1.start()
messenger2.start()

https://www.youtube.com/watch?v=WaXK8G1hb_Q

Comments

Popular posts from this blog

Pyhton 3.4 - Continue

Conversations Ongoing: Valuing Modernization in Early European History

Conversations Ongoing: A Bunch of Amateurs