Problem is that you're actually calling your method when passing it as argument of Thread
.
So it executes, but in the current thread, that's why it's working but it's blocking (and since it probably returns None
, you get no error from the Thread
object, it just blocks)
Remove parentheses to pass the function object, not the result from the call!
thread = Thread(target = processEmail.main)
thread.start()
Note: some IDEs like PyCharm automatically add parentheses to function names. That's a bad idea in that case :)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…