2005年09月04日 星期日 14:05
原来是用python2.4.1来编程序的,但是感觉功能稍微弱了一点,于是想用pythonwin来试试。
但现在遇到一些问题,几个我原来在python2.4.1调试通过的程序,换用pythonwin就不行了,要报错。看了一下,都是说什么什么东西没有定义之类的,是不是它对定义有什么特别的要求啊?
附一段程序:
def start_a(self,attrs):
a="".join( [v for (k,v) in attrs if k=="href"])
import re
patternresult=re.match(r'^asp_gg_ssq.asp\?qishu',a)
if patternresult!=None:
self.cpdate+=1
调试的时候就说name 'a' is not defined
2005年09月04日 星期日 14:36
Lee DYER wrote: > def start_a(self,attrs): > > a="".join( [v for (k,v) in attrs if k=="href"]) > import re > patternresult=re.match(r'^asp_gg_ssq.asp\?qishu',a) > if patternresult!=None: > self.cpdate+=1 > > > 调试的时候就说name 'a' is not defined 调整一下缩进 -- Qiangning Hong http://www.hn.org/hongqn (RSS: http://feeds.feedburner.com/hongqn) Registered Linux User #396996 Get Firefox! <http://www.spreadfirefox.com/?q=affiliates&id;=67907&t;=1> Thunderbird! <http://www.spreadfirefox.com/?q=affiliates&id;=67907&t;=183>
2005年09月05日 星期一 19:52
退订
Zeuux © 2025
京ICP备05028076号