我写了一个socket服务器,使用了协程进行驱动,可以进行连接但是出现了bug,启动之后如果使用谷歌浏览器进行访问如果一段时间不刷新或者不用新的页面访问就会报错Traceback (most recent call last):File "E:/git/web-socket/DAWN/IOloop.py", line 126, in <module>event.run_forever()File "E:/git/web-socket/DAWN/IOloop.py", line 49, in r……
修改
#!/usr/bin/env python3#-*- coding: utf-8 -*-def triangles():L2=[1]for s in range(3):n=1while n<s:a=L1[n-1]+L1[n]L2[n]=an+=1yield L2L1=tuple(L2)L2.insert(-1,1)n = 0results = []for t in triangles():print('t=',’t)results.append(t)print('results=',results)……
修改