我有下面的代码,通过匹配不同的图案RuntimeError:最大递归深度超过
def urlChange(self, event):
text = self.txtUrl.GetValue()
matches = re.findall('GET (\S+).*Host: (\S+).*Cookie: (.+\S)\s*', text, re.DOTALL or re.MULTILINE)
if matches:
groups = matches[0]
self.txtUrl.SetValue(groups[1] + groups[0])
self.txtCookie.SetValue(groups[2])
else:
matches = re.findall('GET (\S+).*Host: (\S+).*', text, re.DOTALL or re.MULTILINE)
if matches:
groups = matches[0]
self.txtUrl.SetValue(groups[1] + groups[0])
self.txtCookie.Clear()
else:
matches = re.findall('.*(http://\S+)', text, re.DOTALL or re.MULTILINE)
if matches:
self.txtUrl.SetValue(matches[0])
matches = re.findall('.*Cookie: (.+\S)', text, re.DOTALL or re.MULTILINE)
if matches:
self.txtCookie.SetValue(matches[0])
提取从文本两个字符串只有当最后re.findall('.*(http://\S+)'...
语句运行出现以下错误信息:
Traceback (most recent call last):
File "./curl-gui.py", line 105, in urlChange
text = self.txtUrl.GetValue()
RuntimeError: maximum recursion depth exceeded
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python2.6/dist-packages/apport_python_hook.py", line 48, in apport_excepthook
if not enabled():
File "/usr/lib/python2.6/dist-packages/apport_python_hook.py", line 21, in enabled
import re
RuntimeError: maximum recursion depth exceeded while calling a Python object
Original exception was:
Traceback (most recent call last):
File "./curl-gui.py", line 105, in urlChange
text = self.txtUrl.GetValue()
RuntimeError: maximum recursion depth exceeded
我什么都不知道,但它看起来像问题是'self.txtUrl.GetValue()`行。 “GetValue”有什么作用? – Kobi 2011-01-12 12:06:06