我怎么能等到线程完成它的过程?

时间:2017-11-21 16:02:34

标签: python python-3.x

我用

threading.Thread(target=ftp1.ftptester, args=[self.finallist], daemon=False).start()

处理文件列表可能需要3分钟才能完成ftptester功能,下面的代码只需要在完成我尝试的线程后执行

kl=threading.Thread(target=ftp1.ftptester, args=[self.finallist], daemon=False).start()

kl.join()

但它给了我错误

AttributeError: 'NoneType' object has no attribute 'join'

注意*线程是从asyncio调用的 - > eventloop-> run_until_complete

1 个答案:

答案 0 :(得分:1)

因为你已经在结束时调用了start并且start返回了一个你已经明确清除了你的kl变量的无类型。这应该解决它。

div:focus {
    background-color:red;
}


<div tabindex="1">
Section 1
</div>

<div tabindex="2">
Section 2
</div>

<div tabindex="3">
Section 3
</div>
相关问题