线程demo异常处理

今天写了个线程小demo,出现了异常,

如下:

Traceback (most recent call last):
 File "threading.py", line 1, in <module>
  import threading
 File "C:\Users\andy\AppData\Local\Programs\Python\Python37\threading.py", line 3, in <module>
  class mythread(threading.Thread):
AttributeError: module 'threading' has no attribute 'Thread'

原因:自己的文件名与系统中的文件名冲突,优先使用了自己写的。

处理方法:把自己的文件名改一下就好了。

posted @ 2019-03-20 17:06  始觉春空  阅读(134)  评论(0编辑  收藏  举报