Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

The queue Module: Part 1

Give Feedback

In this lesson, you’ll use the queue module and threading events to improve your pipeline. If you download the sample code, you can get your own copy of 13-queue.py:

Download

Sample Code (.zip)

12.9 KB

To learn more, you can also check out the documentation for threading.Event, the queue module, and super.

Comments & Discussion

Michal on Nov. 29, 2019

Does it mean you get no NameError or AttributeError message whatsoever, despite referencing undefined names FINISH and self.message? That’s kind of scary.

Lee RP Team on Nov. 30, 2019

Yes :( That is one of the drawbacks of working with threads. This thread on StackOverflow might be interesting to you: stackoverflow.com/questions/2829329/catch-a-threads-exception-in-the-caller-thread-in-python

Become a Member to join the conversation.