非常非常感谢。
当语句为setDaemon(False)时,我测试了五次,结果如下:
第一次:
The Endreading
0
>>>
reading 1
reading 2
第二次:
readingThe End
0
>>>
reading 1
reading 2
第三次:
readingThe End
0
>>>
reading 1
reading 2
第四次:
readingThe End
0
>>>
reading 1
reading 2
第五次:
The Endreading
0
>>>
reading 1
reading 2
当语句为setDaemon(True)时,我又测试了五次,结果如下:
第一次:
readingThe End
0
>>> reading 1
reading 2
第二次:
readingThe End
0
>>>
reading 1
reading 2
第三次:
The Endreading
>>> 0
reading 1
reading 2
第四次:
readingThe End
0
>>>
reading 1
reading 2
第五次:
The Endreading
0
>>>
reading 1
reading 2
感觉无论是True还是False,结果没有什么区别,而且结果是随机的。
【 在 wincss 的大作中提到: 】
: 我觉得你的问题可能是这样
: 并不是说打印了 The End 主线程就会“立刻”结束,可能还会持续一小段时间,所以
: 可能足够 daemon 的子线程打出来点东西
: ...................
--
FROM 1.95.148.*