2006年05月01日 星期一 00:59
On 4/30/06, biosedit at gmail.com <biosedit at gmail.com> wrote: > > |#!/usr/bin/python > 3 |# This Python file uses the following encoding: utf-8 > 4 |import re > 5 |pattern='^[^1]' > 6 |f=open('/var/log/apache2/access.log','r') > 7 |readlines=f.readlines() > 8 |for str in readlines: > 9 | li =re.compile(pattern) > 10 | li.search(pattern).groups() > 11 |f.close() > | 这该不会就是你的源代码吧?你把行号都copy过去了?这肯定是不行的。 File "./http.py", line 9 > li.search(pattern).groups() > ^ > IndentationError: unindent does not match any outer indentation level > > http://www.woodpecker.org.cn/obp/diveintopython-zh-5.4/zh-cn/dist/html/toc/index.html > groups()该怎么用 > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to python-chinese-request at lists.python.cn > Detail Info: http://python.cn/mailman/listinfo/python-chinese > > -- Best Regards Shixin Zeng -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060501/5e77c03c/attachment-0001.html
2006年05月01日 星期一 11:06
2006/5/1, Shixin Zeng <zeng.shixin at gmail.com>: > > > > On 4/30/06, biosedit at gmail.com <biosedit at gmail.com> wrote: > > |#!/usr/bin/python > > 3 |# This Python file uses the following encoding: utf-8 > > 4 |import re > > 5 |pattern='^[^1]' > > 6 |f=open('/var/log/apache2/access.log','r') > > 7 |readlines=f.readlines() > > 8 |for str in readlines: > > 9 | li =re.compile(pattern) > > 10 | li.search(pattern).groups() > > 11 |f.close() > > | > > > 这该不会就是你的源代码吧?你把行号都copy过去了?这肯定是不行的。 > 不是,这个编辑器里的行号 > > > File "./http.py", line 9 > li.search(pattern).groups() > ^ > IndentationError: unindent does not match any outer indentation level > http://www.woodpecker.org.cn/obp/diveintopython-zh-5.4/zh-cn/dist/html/toc/index.html > groups()该怎么用 > > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to > python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to > python-chinese-request at lists.python.cn > Detail Info: > http://python.cn/mailman/listinfo/python-chinese > > > > > -- > Best Regards > > Shixin Zeng > _______________________________________________ > python-chinese > Post: send python-chinese at lists.python.cn > Subscribe: send subscribe to > python-chinese-request at lists.python.cn > Unsubscribe: send unsubscribe to > python-chinese-request at lists.python.cn > Detail Info: > http://python.cn/mailman/listinfo/python-chinese > >
Zeuux © 2025
京ICP备05028076号