Python Programming Tutorial – 34 – threading

///Python Programming Tutorial – 34 – threading

Python Programming Tutorial – 34 – threading

FavoriteLoadingAdd to favorites

Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –

By |2017-05-17T21:21:21+00:00May 17th, 2017|Python Video Tutorials|42 Comments


  1. Marco Küper May 17, 2017 at 9:22 pm - Reply

    Traceback (most recent call last):
      File "D:/PythonLernen/", line 1, in <module>
        import threading
      File "", line 3, in <module>
        class MyMessenger(threading.Thread):
    AttributeError: ‘module’ object has no attribute ‘Thread’

  2. Aaron May 17, 2017 at 9:23 pm - Reply

    My computer still did them in order, lol. It’s probably too slow to do both threads at once.

  3. ishmam rahman May 17, 2017 at 9:25 pm - Reply

    Can someone pls tell me why is there .getname() in print

  4. Paul Brandt May 17, 2017 at 9:26 pm - Reply

    Thanks Bucky, I have been wondering why my computer did not mix the outputs, I had to go to 10000 to make it work

  5. Anton R May 17, 2017 at 9:27 pm - Reply

    I typed your code exactly the same.. I think.. but the getName()’s don’t print out in a jumbled order.. it’s 10 "Send out messages" then 10 "Receive messages"

    What could be the cause of this?

  6. Dark Seid May 17, 2017 at 9:27 pm - Reply

    But wouldn’t you want to do it in a scenario of only adding which is just cummutative property of addition?

  7. Vladi Ivanov May 17, 2017 at 9:28 pm - Reply

    If the loop is 10 times i see 10 times "send" and after that 10 times "receive", but if the loop is 100 I see first 3 times "send", after that – receive, send, receive, etc. , why is like that ?

  8. A Boima May 17, 2017 at 9:29 pm - Reply

    Very nice tutorial Bucky..cheers.

  9. Mrinvinsibleguy Guy May 17, 2017 at 9:30 pm - Reply

    Can you do blender tutorials?

  10. xxBIGBIRDxx May 17, 2017 at 9:30 pm - Reply

    Do swift tutorials PLEAS

  11. Neo Ex May 17, 2017 at 9:31 pm - Reply

    What can u make with Phython code?

  12. Neo Ex May 17, 2017 at 9:31 pm - Reply

    Is it possible to make a chat program with this Program/Code (Pycharm)?

  13. Wisdombylearningtruth :) May 17, 2017 at 9:32 pm - Reply

    In specific when would we be using threading for a company just curious ?

  14. oldschool1231 May 17, 2017 at 9:38 pm - Reply

    For the past 3 months or I’ve been sidetracked by many different things, so I was surprised today when I saw that Bucky had posted new videos! Not only had he posted some videos, but he had posted loads of them, so he has now put me in the difficult situation of having to watch all of them. Also I had been raring to learn Python for the past few months, so this is just perfect. 

    Welcome back, Bucky. It’d be cool if you responded to this comment. 😛


  15. LiquidOrigami May 17, 2017 at 9:39 pm - Reply


  16. They Pheaktra May 17, 2017 at 9:40 pm - Reply

    why output always change in each time that I run this program?

  17. PotentialEn3rgy May 17, 2017 at 9:41 pm - Reply

    Any suggestions on passing arguments into my run function? Whenever I call start it doesn’t seem to pass arguments to run?

  18. q zorn May 17, 2017 at 9:42 pm - Reply

    will this work on the raspberry pi, opencv, webcam to increase fps? thanks.

  19. alvaro montoya May 17, 2017 at 9:42 pm - Reply

    Bucky, is there a safe way to kill the threads? or does python automatically do it at the end of the program? its probably best to close the threads within the program just to be sure all memory is released properly.

  20. TheOdy897 May 17, 2017 at 9:44 pm - Reply

    Excellent lesson. Nice introduction to parallel programming. Thanks!

  21. marz3335 May 17, 2017 at 9:47 pm - Reply

    Bucky — I’m becoming your #1 fan. There are a ton of tutorials on YT but when I watch yours you really SPELL IT OUT for people and that’s the key. I’ve spent all day trying to figure out how I can have a seconds counter running while other code is executing and this may be it. You’re something else. ++

  22. Mike Nunez May 17, 2017 at 9:49 pm - Reply

    Good videos. Really learned quite a bit of information in an easy to understand way and in a very fast time. I always put your videos at 2x speed, and it’s great information in no time at all.

  23. harsh soni May 17, 2017 at 9:49 pm - Reply

    I don’t know why but in my pycharm this programme don’t give me an output though there is no error durring debugging and running

  24. Snaaapzter. May 17, 2017 at 9:50 pm - Reply

    Dude keep teaching i love the way u do, so easy bruh. Go more in depth with python ill stay tuned. Thank you very much 4 ur time. 

  25. Lakpa Sherpa May 17, 2017 at 9:53 pm - Reply

    Thanks Bucky, I have been wondering why my computer did not mix the outputs, I had to go to 36 to make it work

  26. Jesse Myers May 17, 2017 at 9:53 pm - Reply

    for some reason it doesn’t work for me.. it prints the one i start first 10 times then the second, why is that?

  27. Jacob Dykstra May 17, 2017 at 9:57 pm - Reply

    Don’t forget to return at the end of the run function or the thread will not close and code after the thread might not execute! Great video as always.

  28. rockndancenroll May 17, 2017 at 9:57 pm - Reply

    how is that different from multiprocessing?

  29. Richard Northrup May 17, 2017 at 9:57 pm - Reply


  30. Splinter 479 May 17, 2017 at 9:58 pm - Reply

    Hej Bucky,
    i was desperately waiting for a practical example on python’s multi threading. In the next videos you build a Word Frequency Counter. Wouldn’t it be a suitable case to use multi-treading if you split the text first? This way you could explain how to load the threads with the data and merge it afterwards. I’d be thankful to see something like this, you do great tutorials! 🙂

  31. 刘流文 May 17, 2017 at 9:59 pm - Reply

    Thanks Bucky

  32. Tatrasiel7 May 17, 2017 at 10:01 pm - Reply

    I could see this becoming a simple chat tutorial.

  33. Aditya Kushwaha May 17, 2017 at 10:02 pm - Reply

    why do we use this statement??  – print(threading.currentThread().getName())

  34. robert aspelin May 17, 2017 at 10:07 pm - Reply

    Is this how you make multi-core(processor) software?

  35. Ali Vahab May 17, 2017 at 10:12 pm - Reply

    Very nice tutorials, cheers:)

  36. NOOR REZA May 17, 2017 at 10:13 pm - Reply

    Good one.

  37. Rohan Bharadwaj May 17, 2017 at 10:16 pm - Reply

    Hey Bucky. Can you please do a Scala tutorial? I know the really basic stuff since I know Java, but I’d like to learn more. Thanks.

  38. Pyramid132420 May 17, 2017 at 10:18 pm - Reply

    Doesn’t the Python Global Interpreter Lock prevent multithreading?

  39. Abhishek Kaushik May 17, 2017 at 10:18 pm - Reply

    Thanks Bucky,,,,, Cool Videos 😀

  40. What I Wish I Knew May 17, 2017 at 10:18 pm - Reply

    If output prints send 10 times and then received 10 times. Make sure you are using single quotes when passing name argument in BuckysMessenger class constructor. example x = BuckysMessenger(name=’send out messages’)

  41. Tsuki May 17, 2017 at 10:20 pm - Reply

    wow why so many at once?! thanks tho 😀

  42. Jason Cheladyn May 17, 2017 at 10:21 pm - Reply

    Awesome, always wanted to practice this. And with my fav lang!

Leave A Comment