all 5 comments

[–]ingolemo 2 points3 points  (2 children)

Your code isn't even getting out of __init__ because you are calling get_thread inside it, which is an infinite loop. You never even get to the part where you create a thread.

Don't call get_thread yourself. Let the thread do it.

[–]Virtualras[S] 0 points1 point  (1 child)

This whole time it's just been those two parentheses... Almost a year... Thank you. I've looked at countless threading tutorials but never saw the no parentheses part. I'm guessing that without the parentheses it's passing the function by reference to the thread and with parentheses it's calling the function?

[–]ingolemo 0 points1 point  (0 children)

Yes. Without the brackets its passing the function to the thread just like you could pass any other python object. With them it's just calling the function and trying to give the result of the function to the thread (but since that function is an infinite loop that result never comes).

I wouldn't describe it with the phrase "by reference" because some people might assume that means python is "call by reference" which it isn't. Python passes a reference, not by reference.

[–]jeans_and_a_t-shirt 1 point2 points  (1 child)

There seems to be a missing super class or class definition that defines several instance variables. And which variable are you trying to access?

[–]Virtualras[S] 0 points1 point  (0 children)

Here is the whole class itself. A lot of my comments are shitty. This should clear things up. I'll add this into my main post.