2006年07月11日 星期二 09:51
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 大家好,如下的字符串: ...125.244.195.194 8080 squid Proxy KR 2006-7-10 125.244.39.67 8080 squid Proxy KR 2006-7-10 ... 可以使用python的正则表达式简单的抽取出以下结果吗? ... (125.244.195.194, 8080, KR) (125.244.39.67, 8080, KR) (125.244.54.130, 8080, KR) ... -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.4 (MingW32) iD8DBQFEswQy90pbDJCgbHoRAviSAJ9HAANCdaH7Sav9pfrSE52FIKwqdwCeOufm w+NqopXfvPNOQFNZBE5etEo= =BBQc -----END PGP SIGNATURE----- 125.244.54.130 8080 squid Proxy KR 2006-7-10
2006年07月11日 星期二 12:46
我的系统是winxp + sp2 软件:Apache/2.0.58 (Win32) mod_python/3.2.5b Python/2.4.3 在import _apache时,出现以下错误 ImportError: No module named _apache 前面有个兄弟说是软件version的问题 不知道是哪个软件的版本不对啊? 谢谢指导! _________________________________________________________________ 享用世界上最大的电子邮件系统― MSN Hotmail。 http://www.hotmail.com
2006年07月11日 星期二 13:10
用XML DOM 实现. ----- Original Message ----- From: "Cauchy Song" <cauchy.song at gmail.com> To: <python-chinese at lists.python.cn> Sent: Tuesday, July 11, 2006 9:51 AM Subject: [python-chinese] 可以使用正则表达式抽取字段吗? -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 大家好,如下的字符串: ...125.244.195.194 8080 squid Proxy KR 2006-7-10 125.244.39.67 8080 squid Proxy KR 2006-7-10 ... 可以使用python的正则表达式简单的抽取出以下结果吗? ... (125.244.195.194, 8080, KR) (125.244.39.67, 8080, KR) (125.244.54.130, 8080, KR) ... -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.4 (MingW32) iD8DBQFEswQy90pbDJCgbHoRAviSAJ9HAANCdaH7Sav9pfrSE52FIKwqdwCeOufm w+NqopXfvPNOQFNZBE5etEo= =BBQc -----END PGP SIGNATURE----- _______________________________________________ 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 125.244.54.130 8080 squid Proxy KR 2006-7-10
2006年07月11日 星期二 13:10
大哥,低级错误。 Python中所有以一个下划线开头的东西,包括各种对象,变量,方法,模块等等,都是私有的。你当然不可以引用了。 另外,我测试过3.2.5B和3.2.8有很大的区别,如果你不想升级时很麻烦的话,最好还是抓紧用3.2.8吧。
2006年07月11日 星期二 14:21
自己写一个字符串解析函数就ok了。 On 7/11/06, netkiller <openunix at 163.com> wrote: > > > 用XML DOM 实现. > ----- Original Message ----- > From: "Cauchy Song" <cauchy.song at gmail.com> > To: <python-chinese at lists.python.cn> > Sent: Tuesday, July 11, 2006 9:51 AM > Subject: [python-chinese] 可以使用正则表达式抽取字段吗? > > > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > 大家好,如下的字符串: > > ... >> 125.244.195.194 8080 >squid Proxy >KR >2006-7-10 >> 125.244.39.67 8080 >squid Proxy >KR >2006-7-10 >> 125.244.54.130 8080 >squid Proxy >KR >2006-7-10 > ... > > 可以使用python的正则表达式简单的抽取出以下结果吗? > ... > (125.244.195.194, 8080, KR) > (125.244.39.67, 8080, KR) > (125.244.54.130, 8080, KR) > ... > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.4 (MingW32) > > iD8DBQFEswQy90pbDJCgbHoRAviSAJ9HAANCdaH7Sav9pfrSE52FIKwqdwCeOufm > w+NqopXfvPNOQFNZBE5etEo= > =BBQc > -----END PGP SIGNATURE----- > > _______________________________________________ > 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 > > > > > _______________________________________________ > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060711/ce4c42df/attachment.html
2006年07月11日 星期二 15:14
On Tuesday 11 July 2006 13:10, gashero wrote: > 大哥,低级错误。 > Python中所有以一个下划线开头的东西,包括各种对象,变量,方法,模块等等,都是私有的。你当然不可以引用了。 是么?解释一下? > 另外,我测试过3.2.5B和3.2.8有很大的区别,如果你不想升级时很麻烦的话,最好还是抓紧用3.2.8吧。 -- PogoLinux(Shanghai),Inc. http://www.pogolinux.com.cn (8621)50308860 Ext.31
2006年07月11日 星期二 15:23
Python对私有变量提供了有限的支持,但Python里并没有真正私有的东西。见文档: There is limited support for class-private identifiers. Any identifier of the form __spam (at least two leading underscores, at most one trailing underscore) is textually replaced with _classname__spam, where classname is the current class name with leading underscore(s) stripped. This mangling is done without regard to the syntactic position of the identifier, so it can be used to define class-private instance and class variables, methods, variables stored in globals, and even variables stored in instances. private to this class on instances of *other* classes. Truncation may occur when the mangled name would be longer than 255 characters. Outside classes, or when the class name consists of only underscores, no mangling occurs. On 7/11/06, gashero <harry.python at gmail.com> wrote: > > 大哥,低级错误。 > Python中所有以一个下划线开头的东西,包括各种对象,变量,方法,模块等等,都是私有的。你当然不可以引用了。 > 另外,我测试过3.2.5B和3.2.8有很大的区别,如果你不想升级时很麻烦的话,最好还是抓紧用3.2.8吧。 > > _______________________________________________ > 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 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060711/50aec724/attachment.html
2006年07月11日 星期二 21:06
这只是一个简单的例子,未来会更复杂,我想通过配置正则表达式来处理各种情况,而不是为每一种情况都写xml或string解析方法。 在 06-7-11,尹祥龙<yinxianglong at gmail.com> 写道: > 自己写一个字符串解析函数就ok了。 > > > > On 7/11/06, netkiller <openunix at 163.com> wrote: > > > > 用XML DOM 实现. > > ----- Original Message ----- > > From: "Cauchy Song" < cauchy.song at gmail.com> > > To: <python-chinese at lists.python.cn> > > Sent: Tuesday, July 11, 2006 9:51 AM > > Subject: [python-chinese] 可以使用正则表达式抽取字段吗? > > > > > > > > -----BEGIN PGP SIGNED MESSAGE----- > > Hash: SHA1 > > > > 大家好,如下的字符串: > > > > ... > >> > 125.244.195.194 8080 > >squid Proxy > >KR > >2006-7-10 > >> > 125.244.39.67 8080 > >squid Proxy > >KR > >2006-7-10 > >> > 125.244.54.130 8080 > >squid Proxy > >KR > >2006-7-10 > > ... > > > > 可以使用python的正则表达式简单的抽取出以下结果吗? > > ... > > (125.244.195.194, 8080, KR) > > ( 125.244.39.67, 8080, KR) > > (125.244.54.130, 8080, KR) > > ... > > > > -----BEGIN PGP SIGNATURE----- > > Version: GnuPG v1.4.4 (MingW32) > > > > > iD8DBQFEswQy90pbDJCgbHoRAviSAJ9HAANCdaH7Sav9pfrSE52FIKwqdwCeOufm > > w+NqopXfvPNOQFNZBE5etEo= > > =BBQc > > -----END PGP SIGNATURE----- > > > > _______________________________________________ > > 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 > > > > > > > > > > _______________________________________________ > > 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 > > > > > _______________________________________________ > 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 > >
2006年07月11日 星期二 23:04
如果要考虑复杂的情况和未来的变化,用BeautifulSoup之类的专用html解析库(比通用的DOM更方便些)绝对比自己写正则安全省力,代码的可读性和扩展性也要好得多。 On 7/11/06, Cauchy Song <cauchy.song at gmail.com> wrote: > > 这只是一个简单的例子,未来会更复杂,我想通过配置正则表达式来处理各种情况,而不是为每一种情况都写xml或string解析方法。 > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060711/9b8cf18a/attachment.html
2006年07月11日 星期二 23:17
这种写法与其说是语法,不如说更接近"约定"。 模块作者声明这些名字不作为公开的api,模块使用者也应该有意识的避免使用。 必要的时候绕过约定是允许的,但也要付出代价――相比起公开的api,作者是完全不需要保证这些私有成员的稳定性和向后兼容性的。 On 7/11/06, mouqx xu <zsuxqm at gmail.com> wrote: > > Python对私有变量提供了有限的支持,但Python里并没有真正私有的东西。见文档: > There is limited support for class-private identifiers. Any identifier of > the form __spam (at least two leading underscores, at most one trailing > underscore) is textually replaced with _classname__spam, where classnameis the current class name with leading underscore(s) stripped. This mangling > is done without regard to the syntactic position of the identifier, so it > can be used to define class-private instance and class variables, methods, > variables stored in globals, and even variables stored in instances. private > to this class on instances of *other* classes. Truncation may occur when > the mangled name would be longer than 255 characters. Outside classes, or > when the class name consists of only underscores, no mangling occurs. > > On 7/11/06, gashero <harry.python at gmail.com> wrote: > > > 大哥,低级错误。 > Python中所有以一个下划线开头的东西,包括各种对象,变量,方法,模块等等,都是私有的。你当然不可以引用了。 > 另外,我测试过3.2.5B和3.2.8有很大的区别,如果你不想升级时很麻烦的话,最好还是抓紧用3.2.8吧。 > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060711/3348842e/attachment.htm
2006年07月12日 星期三 09:06
r'^[a-z]+ $' ----- Original Message ----- From: "Cauchy Song" <cauchy.song at gmail.com> To: <python-chinese at lists.python.cn> Sent: Tuesday, July 11, 2006 9:06 PM Subject: Re: [python-chinese] 可以使用正则表达式抽取字段吗? > 这只是一个简单的例子,未来会更复杂,我想通过配置正则表达式来处理各种情况,而不是为每一种情况都写xml或string解析方法。 > > 在 06-7-11,尹祥龙<yinxianglong at gmail.com> 写道: >> 自己写一个字符串解析函数就ok了。 >> >> >> >> On 7/11/06, netkiller <openunix at 163.com> wrote: >> > >> > 用XML DOM 实现. >> > ----- Original Message ----- >> > From: "Cauchy Song" < cauchy.song at gmail.com> >> > To: <python-chinese at lists.python.cn> >> > Sent: Tuesday, July 11, 2006 9:51 AM >> > Subject: [python-chinese] 可以使用正则表达式抽取字段吗? >> > >> > >> > >> > -----BEGIN PGP SIGNED MESSAGE----- >> > Hash: SHA1 >> > >> > 大家好,如下的字符串: >> > >> > ... >> >>> > 125.244.195.194 8080 >> >squid Proxy >> >KR >> >2006-7-10 >> >>> > 125.244.39.67 8080 >> >squid Proxy >> >KR >> >2006-7-10 >> >>> > 125.244.54.130 8080 >> >squid Proxy >> >KR >> >2006-7-10 >> > ... >> > >> > 可以使用python的正则表达式简单的抽取出以下结果吗? >> > ... >> > (125.244.195.194, 8080, KR) >> > ( 125.244.39.67, 8080, KR) >> > (125.244.54.130, 8080, KR) >> > ... >> > >> > -----BEGIN PGP SIGNATURE----- >> > Version: GnuPG v1.4.4 (MingW32) >> > >> > >> iD8DBQFEswQy90pbDJCgbHoRAviSAJ9HAANCdaH7Sav9pfrSE52FIKwqdwCeOufm >> > w+NqopXfvPNOQFNZBE5etEo= >> > =BBQc >> > -----END PGP SIGNATURE----- >> > >> > _______________________________________________ >> > 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 >> > >> > >> > >> > >> > _______________________________________________ >> > 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 >> > >> >> >> _______________________________________________ >> 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 >> >> > -------------------------------------------------------------------------------- > _______________________________________________ > 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号