Python论坛  - 讨论区

标题:[python-chinese] 新手请教SGMLParser和HTMLParser

2007年11月01日 星期四 02:01

hechu hcpython在gmail.com
星期四 十一月 1 02:01:06 HKT 2007

一个HTML附件被移除...
URL: http://python.cn/pipermail/python-chinese/attachments/20071101/08a6367a/attachment.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年11月01日 星期四 09:25

aaron aaronkowk在gmail.com
星期四 十一月 1 09:25:06 HKT 2007

лл£¬ÎÒ×îºóÒ²ÊÇÖ±½ÓÓÃÁËSGMLParser£¬ÏÖÔÚÕâ·½ÃæÊÇûʲôÎÊÌ⣬ÎÒÒ²¸Ð¾õSGMLParser¸ü·½±ãÒ»µã¡£
µ«ÊÇÎÒÓöµ½Á˱ðµÄÎÊÌ⣬ÎÒÁíÍâÔÙ¿ªÌù˵Ã÷ºÃÁË¡£

Áí£ºÏëÇëÎÊÒ»ÏÂÄãÕâÐдúÂë
url = "%s%s"%("http://mp3.baidu.com/m?f=ms&rn;=&tn;=baidump3&ct;=134217728">,
"&word;=%CD%B4%B3%B9%D0%C4%EC%E9+%BD%AA%D3%F1%D1%F4&lm;=-1")
Èç¹ûÀ¨ºÅÀïÃæ2ÏÊÇÇ°Ãæ´Ó±íµ¥È¡µÃµÄÁ½¸ö±äÁ¿£¬ÀýÈçurlaºÍurlb£¬»¹ÊÇд³Éurl = "%s%s"%(urla, urlb)ÕâÑùÂð£¿Óëurl =
urla + urlbÏà±ÈÓÐʲôºÃ´¦£¿Ð»Ð»£¡


ÔÚ07-11-1£¬hechu <hcpython在gmail.com> дµÀ£º
>
> ÄãÁ½¸ö¶¼ÊÔÊÔ£¬¾ÍÃ÷°×ÁË¡£8ÔÂÎÒд¹ýÒ»¸öÍøÒ³·ÖÎöµÄ¶«¶«£¬Á½¸öÄ£¿é¶¼³¢ÊÔºó£¬ÎÒÑ¡ÔñÁË SGMLLIB¡£
> ÏÖÔÚÍü¼Çϸ½ÚÁË£¬ºÃÏñ¾õµÃSGMLLIB±àд¸ü·½±ã£¬¸üÊʺÏÎÒµ±Ê±×öµÄÒ³Ãæ·ÖÎö¹¤×÷¡£
>
> ·Ï»°²»Ëµ£¬ÉÏ´úÂ룡µ±È»ÊǾ«¼ò¹ýµÄ´úÂ룬¾­²âÊÔ¿ÉÒÔÔËÐС£
> ÏÂÃæ´úÂëÑÝʾÁË´Ó°Ù¶Èmp3ËÑË÷Ò³ÃæÖÐËÑË÷µ½Ä³Ê׸èÇúºó£¬¸ù¾Ý¸èÊÖÃûºÍ¸èÇúÃû£¬·ÖÎöÕÒµ½¸Ã¸èÇúµÄÊÔÌýµØÖ·¡£
> ÕâÖÖÊÂÇ飬Ïë±ØÁбíÖеĺܶà´óÀж¼×ö¹ý°É¡£
>
> code:
>   #!/usr/bin/env python
> # -*- coding: cp936 -*-
>
> import sys
> import socket
> import urllib
> import urllib2
> import httplib
> import threading
> import time
> import string
> import logging
> import sgmllib
> import cookielib
> import win32com.client
> # from adoconstants import *
>
>
> class ListParser(sgmllib.SGMLParser):
>     def __init__(self, song, singer, sid=0, verbose=0):
>         self.song = song
>         self.singer = singer
>         sgmllib.SGMLParser.__init__(self, verbose)
>
>     def reset(self):
>         sgmllib.SGMLParser.reset(self)
>         self.is_url = False
>         self.current_singer = ""
>         self.url = ""
>         self.urls = []
>
>     def handle_data(self, data):
>         if self.is_url:
>             if self.url.find("http://mp3.baidu.com/singerlist/">)
> != -1:
>                 self.current_singer = data
>                 #print "----------------------"
>             if data == r"ÊÔÌý":
>                 # print self.url
>                 if self.singer != "":
>                     if self.current_singer == self.singer:
>                         self.urls.append(self.url)
>                 else:
>                     self.urls.append(self.url)
>
>     def start_a(self, attrs):
>         #print "start tag "
>         for k, v in attrs:
>             if k == "href":
>                 href = v
>         if href:
>             self.is_url = True
>             self.url = href
>
>     def end_a(self):
>         self.is_url = False
>
>     def close(self):
>         sgmllib.SGMLParser.close(self)
>
>
> def test1(args = None):
>     url = "%s%s"%(
> "http://mp3.baidu.com/m?f=ms&rn;=&tn;=baidump3&ct;=134217728">
> ,
>                 "&word;=%CD%B4%B3%B9%D0%C4%EC%E9+%BD%AA%D3%F1%D1%F4&lm;=-1")
>     page = urllib2.urlopen(url)
>     data = page.read()
>     x = ListParser(r"Í´³¹ÐÄìé", r"½ªÓñÑô")
>     x.feed(data)
>     x.close()
>     for url in x.urls:
>         print "%s\r\n"%url
>         pass
>
> if __name__ == "__main__":
>     test1()
>
> aaron дµÀ:
>
>
> ÏÈÉùÃ÷£¬ÎÒÊÇÒ»¸öÐÂÊÖ£¬¸Õ½Ó´¥Python²»µ½Ò»¸öÔ£¬ÒªÀûÓÃPython×öÒ»¸öÀàËÆËÑË÷ÒýÇæÈ»ºóÊý¾Ý¿â·ÖÎöµÄ¹¤¾ß¡£½ñÌìÓöµ½Ò»¸öÎÊÌ⣬µÚÒ»´Î·¢ÎÄÇë½Ì£¬»¹Çë´ó¼Ò¶à¶à°üº­£¡:)
>
> ¿´Ò»°ãµÄpythonÈëÃŵÄÊ鼮ʱ½éÉÜʹÓÃHTMLParserÄ£¿éÀ´·ÖÎöHTMLÒ³Ã棬¿ÉÊÇ"Dive Into
> Python"ÄDZ¾ÊéÀïÈ´ÊÇʹÓÃSGMLParserÄ£¿éÀ´·ÖÎö£¬²»ÖªµÀÁ½ÕßÓÐʲôÇø±ð£¬ÎÒÒ²×Ô¼ºÊÔ×ÅËÑË÷ÁËһϣ¬Ã»ÓÐÕÒµ½±È½ÏÃ÷È·ÉîÈëÒ»µãµÄ·ÖÎö¡£Ö»ÊǾõµÃSGMLParserÓÐÒ»¸ö¹¦ÄÜ¿´ÉÏȥͦ"ÉñÆæ"µÄ£¬¾ÍÊÇÀýÈçÓöµ½¿ÉÒÔÖ±½Óµ÷ÓÃstart_a·½·¨£¬¶øHTMLParserÀïÃ滹ҪÓÐÒ»¾ä"if
> tag == 'a':"µÄÅжϡ£µ«ÊÇÒ²¿´µ½Ä³Ð©ÈËÆÀÂÛ˵×öHTMLÒ³Ãæ·ÖÎö×îºÃ»¹ÊÇÓÃHTMLParser£¬²»ÖªµÀÓÐʲôµÀÀí¡£
> ÁíÍ⣬HTMLParserËƺõÒ²ÓÐÁ½¸ö£¬Ò»¸öÊÇHTMLParserÀïÃæµÄ£¬Ò»¸öÊÇhtmllibÀïÃæµÄ£»¶øSGMLParserÊÇ
> sgmllibÀïÃæµÄ¡£
> Çë´ó¼Ò¸øµã·ÖÎöÒâ¼û£¬Ð»Ð»£¡
>
> --
> Ì쾲ɳ
>
> ------------------------------
>
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>



-- 
Ì쾲ɳ
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20071101/4d3578d4/attachment.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年11月01日 星期四 09:26

aaron aaronkowk在gmail.com
星期四 十一月 1 09:26:05 HKT 2007

ÉÏÒ»·âÓ¦¸ÃÊÇ»ØÕâ¸öµÄ£¬»Ø´íÁË£¬²»ºÃÒâ˼£¬×Ô¼ººÃÏñû·¨¸Ä£¿

ÔÚ07-11-1£¬hechu <hcpython在gmail.com> дµÀ£º
>
> ÄãÁ½¸ö¶¼ÊÔÊÔ£¬¾ÍÃ÷°×ÁË¡£8ÔÂÎÒд¹ýÒ»¸öÍøÒ³·ÖÎöµÄ¶«¶«£¬Á½¸öÄ£¿é¶¼³¢ÊÔºó£¬ÎÒÑ¡ÔñÁË SGMLLIB¡£
> ÏÖÔÚÍü¼Çϸ½ÚÁË£¬ºÃÏñ¾õµÃSGMLLIB±àд¸ü·½±ã£¬¸üÊʺÏÎÒµ±Ê±×öµÄÒ³Ãæ·ÖÎö¹¤×÷¡£
>
> ·Ï»°²»Ëµ£¬ÉÏ´úÂ룡µ±È»ÊǾ«¼ò¹ýµÄ´úÂ룬¾­²âÊÔ¿ÉÒÔÔËÐС£
> ÏÂÃæ´úÂëÑÝʾÁË´Ó°Ù¶Èmp3ËÑË÷Ò³ÃæÖÐËÑË÷µ½Ä³Ê׸èÇúºó£¬¸ù¾Ý¸èÊÖÃûºÍ¸èÇúÃû£¬·ÖÎöÕÒµ½¸Ã¸èÇúµÄÊÔÌýµØÖ·¡£
> ÕâÖÖÊÂÇ飬Ïë±ØÁбíÖеĺܶà´óÀж¼×ö¹ý°É¡£
>
> code:
>   #!/usr/bin/env python
> # -*- coding: cp936 -*-
>
> import sys
> import socket
> import urllib
> import urllib2
> import httplib
> import threading
> import time
> import string
> import logging
> import sgmllib
> import cookielib
> import win32com.client
> # from adoconstants import *
>
>
> class ListParser(sgmllib.SGMLParser):
>     def __init__(self, song, singer, sid=0, verbose=0):
>         self.song = song
>         self.singer = singer
>         sgmllib.SGMLParser.__init__(self, verbose)
>
>     def reset(self):
>         sgmllib.SGMLParser.reset(self)
>         self.is_url = False
>         self.current_singer = ""
>         self.url = ""
>         self.urls = []
>
>     def handle_data(self, data):
>         if self.is_url:
>             if self.url.find("http://mp3.baidu.com/singerlist/">)
> != -1:
>                 self.current_singer = data
>                 #print "----------------------"
>             if data == r"ÊÔÌý":
>                 # print self.url
>                 if self.singer != "":
>                     if self.current_singer == self.singer:
>                         self.urls.append(self.url)
>                 else:
>                     self.urls.append(self.url)
>
>     def start_a(self, attrs):
>         #print "start tag "
>         for k, v in attrs:
>             if k == "href":
>                 href = v
>         if href:
>             self.is_url = True
>             self.url = href
>
>     def end_a(self):
>         self.is_url = False
>
>     def close(self):
>         sgmllib.SGMLParser.close(self)
>
>
> def test1(args = None):
>     url = "%s%s"%(
> "http://mp3.baidu.com/m?f=ms&rn;=&tn;=baidump3&ct;=134217728">
> ,
>                 "&word;=%CD%B4%B3%B9%D0%C4%EC%E9+%BD%AA%D3%F1%D1%F4&lm;=-1")
>     page = urllib2.urlopen(url)
>     data = page.read()
>     x = ListParser(r"Í´³¹ÐÄìé", r"½ªÓñÑô")
>     x.feed(data)
>     x.close()
>     for url in x.urls:
>         print "%s\r\n"%url
>         pass
>
> if __name__ == "__main__":
>     test1()
>
> aaron дµÀ:
>
>
> ÏÈÉùÃ÷£¬ÎÒÊÇÒ»¸öÐÂÊÖ£¬¸Õ½Ó´¥Python²»µ½Ò»¸öÔ£¬ÒªÀûÓÃPython×öÒ»¸öÀàËÆËÑË÷ÒýÇæÈ»ºóÊý¾Ý¿â·ÖÎöµÄ¹¤¾ß¡£½ñÌìÓöµ½Ò»¸öÎÊÌ⣬µÚÒ»´Î·¢ÎÄÇë½Ì£¬»¹Çë´ó¼Ò¶à¶à°üº­£¡:)
>
> ¿´Ò»°ãµÄpythonÈëÃŵÄÊ鼮ʱ½éÉÜʹÓÃHTMLParserÄ£¿éÀ´·ÖÎöHTMLÒ³Ã棬¿ÉÊÇ"Dive Into
> Python"ÄDZ¾ÊéÀïÈ´ÊÇʹÓÃSGMLParserÄ£¿éÀ´·ÖÎö£¬²»ÖªµÀÁ½ÕßÓÐʲôÇø±ð£¬ÎÒÒ²×Ô¼ºÊÔ×ÅËÑË÷ÁËһϣ¬Ã»ÓÐÕÒµ½±È½ÏÃ÷È·ÉîÈëÒ»µãµÄ·ÖÎö¡£Ö»ÊǾõµÃSGMLParserÓÐÒ»¸ö¹¦ÄÜ¿´ÉÏȥͦ"ÉñÆæ"µÄ£¬¾ÍÊÇÀýÈçÓöµ½¿ÉÒÔÖ±½Óµ÷ÓÃstart_a·½·¨£¬¶øHTMLParserÀïÃ滹ҪÓÐÒ»¾ä"if
> tag == 'a':"µÄÅжϡ£µ«ÊÇÒ²¿´µ½Ä³Ð©ÈËÆÀÂÛ˵×öHTMLÒ³Ãæ·ÖÎö×îºÃ»¹ÊÇÓÃHTMLParser£¬²»ÖªµÀÓÐʲôµÀÀí¡£
> ÁíÍ⣬HTMLParserËƺõÒ²ÓÐÁ½¸ö£¬Ò»¸öÊÇHTMLParserÀïÃæµÄ£¬Ò»¸öÊÇhtmllibÀïÃæµÄ£»¶øSGMLParserÊÇ
> sgmllibÀïÃæµÄ¡£
> Çë´ó¼Ò¸øµã·ÖÎöÒâ¼û£¬Ð»Ð»£¡
>
> --
> Ì쾲ɳ
>
> ------------------------------
>
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>



-- 
Ì쾲ɳ
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20071101/7350342c/attachment.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年11月01日 星期四 13:35

hechu hcpython在gmail.com
星期四 十一月 1 13:35:52 HKT 2007

一个HTML附件被移除...
URL: http://python.cn/pipermail/python-chinese/attachments/20071101/18fb6a4a/attachment.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年11月01日 星期四 13:43

limodou limodou在gmail.com
星期四 十一月 1 13:43:19 HKT 2007

On 11/1/07, hechu <hcpython在gmail.com> wrote:
>
>  url = "%s%s"%( "http://mp3.baidu.com/m?f=ms&rn;=&tn;=baidump3&ct;=134217728",
>      "&word;=%CD%B4%B3%B9%D0%C4%EC%E9+%BD%AA%D3%F1%D1%F4&lm;=-1")
>
>  这句话纯粹是为了排版好看,如果用一整句的话灰色的底色会被撑开很宽,不好看。所以换成两行写,,,
>  没有其他意思,呵呵,,,让你困惑了一把。。。
>
>  我习惯写成 url = "%s%s"%(urla, urlb)。
>  因为python不是强制类型的,所以变量有可能不是 字符串,所以,有时候用加法会出错。
>  看下面的代码,你就明白了。
>
我认为"python不是强制类型的"这句话说得不对。正是因为是强类型的所以才不能相加。弱类型的才会自动进行转换,如javascript.

-- 
I like python!
UliPad <>: http://code.google.com/p/ulipad/
meide <>: http://code.google.com/p/meide/
My Blog: http://www.donews.net/limodou

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年11月01日 星期四 13:58

Xian Chen hoganxian在gmail.com
星期四 十一月 1 13:58:43 HKT 2007

˵µ½Parser£¬ÎÒнӴ¥Python£¬ÏëŪһ¸öÂÛ̳ҳÃæµÄparse¹¤¾ß£¬¸÷λÓÐûÓкÏÊʵÄÀý×Ó£¿


On 11/1/07, limodou <limodou在gmail.com> wrote:
>
> On 11/1/07, hechu <hcpython在gmail.com> wrote:
> >
> >  url = "%s%s"%( "
> http://mp3.baidu.com/m?f=ms&rn;=&tn;=baidump3&ct;=134217728",
> >      "&word;=%CD%B4%B3%B9%D0%C4%EC%E9+%BD%AA%D3%F1%D1%F4&lm;=-1")
> >
> >  Õâ¾ä»°´¿´âÊÇΪÁËÅÅ°æºÃ¿´£¬Èç¹ûÓÃÒ»Õû¾äµÄ»°»ÒÉ«µÄµ×É«»á±»³Å¿ªºÜ¿í£¬²»ºÃ¿´¡£ËùÒÔ»»³ÉÁ½ÐÐд£¬£¬£¬
> >  ûÓÐÆäËûÒâ˼£¬ºÇºÇ£¬£¬£¬ÈÃÄãÀ§»óÁËÒ»°Ñ¡£¡£¡£
> >
> >  ÎÒÏ°¹ßд³É url = "%s%s"%(urla, urlb)¡£
> >  ÒòΪpython²»ÊÇÇ¿ÖÆÀàÐ͵ģ¬ËùÒÔ±äÁ¿ÓпÉÄܲ»ÊÇ ×Ö·û´®£¬ËùÒÔ£¬ÓÐʱºòÓüӷ¨»á³ö´í¡£
> >  ¿´ÏÂÃæµÄ´úÂ룬Äã¾ÍÃ÷°×ÁË¡£
> >
> ÎÒÈÏΪ"python²»ÊÇÇ¿ÖÆÀàÐ͵Ä"Õâ¾ä»°ËµµÃ²»¶Ô¡£ÕýÊÇÒòΪÊÇÇ¿ÀàÐ͵ÄËùÒԲŲ»ÄÜÏà¼Ó¡£ÈõÀàÐ͵IJŻá×Ô¶¯½øÐÐת»»£¬Èçjavascript.
>
> --
> I like python!
> UliPad <>: http://code.google.com/p/ulipad/
> meide <>: http://code.google.com/p/meide/
> My Blog: http://www.donews.net/limodou
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20071101/3deb8914/attachment.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年11月01日 星期四 14:04

hechu hcpython在gmail.com
星期四 十一月 1 14:04:39 HKT 2007

一个HTML附件被移除...
URL: http://python.cn/pipermail/python-chinese/attachments/20071101/3baca413/attachment.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年11月01日 星期四 14:58

limodou limodou在gmail.com
星期四 十一月 1 14:58:40 HKT 2007

On 11/1/07, hechu <hcpython在gmail.com> wrote:
>
>  ľͷ½²µÄÓÐÀí¡£
> ÎÒµÄÒâ˼ÊÇ£¬pythonÖÐÒ»¸ö±äÁ¿µÄÀàÐÍÊÇ¿ÉÄÜ·¢Éú±ä»¯µÄ¡£
> ±äÁ¿ÉùÃ÷ʱºò£¬Ã»ÓбØÐëÇ¿ÖÆÉùÃ÷±äÁ¿ÀàÐÍ£¬ËùÒÔ²»ÖªµÀ²Ù×÷¹ý³ÌÖÐÊÇ×Ö·û´®»¹ÊÇÊý×Ö¡£¡£¡£
>
> ¾ÍÊÇÏÂÃæÕâ¸öÒâ˼¡£ËùÒÔÏ°¹ßÐԵģ¬²»Óüӷ¨£¬¶øÓøñʽ»¯£º
> code:
>   >>> var = "Hello"
> >>> var = 123456
> >>> var = file("C:\\Python25\\LICENSE.txt")
>
ÕâÊÇÒòΪpythonÖеĸ³ÖµÓï¾äµÄ×÷ÓÃÊÇÓÃÀ´°ó¶¨±äÁ¿Óë¶ÔÏóµÄ£¬Ó뾲̬ÓïÑԵĸ³Öµ²»Ì«Ò»Ñù¡£¿ÉÒÔÏëÏópythonÖеĶÔÏó¶¼ÊÇÒýÓ÷½Ê½¡£

-- 
I like python!
UliPad <>: http://code.google.com/p/ulipad/
meide <>: http://code.google.com/p/meide/
My Blog: http://www.donews.net/limodou
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20071101/a4bdf591/attachment.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年11月01日 星期四 15:21

wentrue(I'm Once) guozhuwen在gmail.com
星期四 十一月 1 15:21:37 HKT 2007

ÎÒʹÓÃSGMLLIBʱ¾­³£ÓÐÒ»¸öÀ§»ó£¬¾ÍÊÇfeedµÄ¹ý³ÌÄܲ»ÄÜÌáÇ°ÖÕÖ¹£¬±ÈÈçÄãµÄ³ÌÐòÀÎÒÖ»ÊÇÏ£ÍûµÃµ½µÚÒ»¸öÁ´½ÓµØÖ·£¬
ÔÚhandle_dataÖеõ½µÚÒ»¸öÓÐÓÃÊý¾Ýºó£¬¾ÍÏ£ÍûÍ˳öfeed£¬¶ø²»ÊÇÿ´Î¶¼Õû¸öÎļþ¶¼½âÊÍÍ꣬ÄǸÃÔõô´¦Àí£¿

ÔÚ07-11-1£¬hechu <hcpython在gmail.com> дµÀ£º
>
>  ÄãÁ½¸ö¶¼ÊÔÊÔ£¬¾ÍÃ÷°×ÁË¡£8ÔÂÎÒд¹ýÒ»¸öÍøÒ³·ÖÎöµÄ¶«¶«£¬Á½¸öÄ£¿é¶¼³¢ÊÔºó£¬ÎÒÑ¡ÔñÁË SGMLLIB¡£
> ÏÖÔÚÍü¼Çϸ½ÚÁË£¬ºÃÏñ¾õµÃSGMLLIB±àд¸ü·½±ã£¬¸üÊʺÏÎÒµ±Ê±×öµÄÒ³Ãæ·ÖÎö¹¤×÷¡£
>
> ·Ï»°²»Ëµ£¬ÉÏ´úÂ룡µ±È»ÊǾ«¼ò¹ýµÄ´úÂ룬¾­²âÊÔ¿ÉÒÔÔËÐС£
> ÏÂÃæ´úÂëÑÝʾÁË´Ó°Ù¶Èmp3ËÑË÷Ò³ÃæÖÐËÑË÷µ½Ä³Ê׸èÇúºó£¬¸ù¾Ý¸èÊÖÃûºÍ¸èÇúÃû£¬·ÖÎöÕÒµ½¸Ã¸èÇúµÄÊÔÌýµØÖ·¡£
> ÕâÖÖÊÂÇ飬Ïë±ØÁбíÖеĺܶà´óÀж¼×ö¹ý°É¡£
>
> code:
>   #!/usr/bin/env python
> # -*- coding: cp936 -*-
>
> import sys
> import socket
> import urllib
> import urllib2
> import httplib
> import threading
> import time
> import string
> import logging
> import sgmllib
> import cookielib
> import win32com.client
> # from adoconstants import *
>
>
> class ListParser(sgmllib.SGMLParser):
>     def __init__(self, song, singer, sid=0, verbose=0):
>         self.song = song
>         self.singer = singer
>         sgmllib.SGMLParser.__init__(self, verbose)
>
>     def reset(self):
>         sgmllib.SGMLParser.reset(self)
>         self.is_url = False
>         self.current_singer = ""
>         self.url = ""
>         self.urls = []
>
>     def handle_data(self, data):
>         if self.is_url:
>             if self.url.find("http://mp3.baidu.com/singerlist/">)
> != -1:
>                 self.current_singer = data
>                 #print "----------------------"
>             if data == r"ÊÔÌý":
>                 # print self.url
>                 if self.singer != "":
>                     if self.current_singer == self.singer:
>                         self.urls.append(self.url)
>                 else:
>                     self.urls.append(self.url)
>
>     def start_a(self, attrs):
>         #print "start tag "
>         for k, v in attrs:
>             if k == "href":
>                 href = v
>         if href:
>             self.is_url = True
>             self.url = href
>
>     def end_a(self):
>         self.is_url = False
>
>     def close(self):
>         sgmllib.SGMLParser.close(self)
>
>
> def test1(args = None):
>     url = "%s%s"%(
> "http://mp3.baidu.com/m?f=ms&rn;=&tn;=baidump3&ct;=134217728">
> ,
>                 "&word;=%CD%B4%B3%B9%D0%C4%EC%E9+%BD%AA%D3%F1%D1%F4&lm;=-1")
>     page = urllib2.urlopen(url)
>     data = page.read()
>     x = ListParser(r"Í´³¹ÐÄìé", r"½ªÓñÑô")
>     x.feed(data)
>     x.close()
>     for url in x.urls:
>         print "%s\r\n"%url
>         pass
>
> if __name__ == "__main__":
>     test1()
>
> aaron дµÀ:
>
> ÏÈÉùÃ÷£¬ÎÒÊÇÒ»¸öÐÂÊÖ£¬¸Õ½Ó´¥Python²»µ½Ò»¸öÔ£¬ÒªÀûÓÃPython×öÒ»¸öÀàËÆËÑË÷ÒýÇæÈ»ºóÊý¾Ý¿â·ÖÎöµÄ¹¤¾ß¡£½ñÌìÓöµ½Ò»¸öÎÊÌ⣬µÚ
> Ò»´Î·¢ÎÄÇë½Ì£¬»¹Çë´ó¼Ò¶à¶à°üº­£¡:)
>
> ¿´Ò»°ãµÄpythonÈëÃŵÄÊ鼮ʱ½éÉÜʹÓÃHTMLParserÄ£¿éÀ´·ÖÎöHTMLÒ³Ã棬¿ÉÊÇ"Dive Into
> Python"ÄDZ¾ÊéÀïÈ´ÊÇʹÓÃSGMLParserÄ£¿éÀ´·ÖÎö£¬²»ÖªµÀÁ½ÕßÓÐʲôÇø±ð£¬ÎÒÒ²×Ô¼ºÊÔ×ÅËÑË÷ÁËһϣ¬Ã»ÓÐÕÒµ½±È½ÏÃ÷È·ÉîÈëÒ»µãµÄ·ÖÎö¡£Ö»ÊÇ
> ¾õµÃSGMLParserÓÐÒ»¸ö¹¦ÄÜ¿´ÉÏȥͦ"ÉñÆæ"µÄ£¬¾ÍÊÇÀýÈçÓöµ½¿ÉÒÔÖ±½Óµ÷ÓÃstart_a·½·¨£¬¶øHTMLParserÀïÃ滹 ÒªÓÐÒ»¾ä"if
> tag == 'a':"µÄÅжϡ£µ«ÊÇÒ²¿´µ½Ä³Ð©ÈËÆÀÂÛ˵×öHTMLÒ³Ãæ·ÖÎö×îºÃ»¹ÊÇÓÃHTMLParser£¬²»ÖªµÀÓÐʲôµÀÀí¡£
> ÁíÍ⣬HTMLParserËƺõÒ²ÓÐÁ½¸ö£¬Ò»¸öÊÇHTMLParserÀïÃæµÄ£¬Ò»¸öÊÇhtmllibÀïÃæµÄ£»¶øSGMLParserÊÇ
> sgmllibÀïÃæµÄ¡£
> Çë´ó¼Ò¸øµã·ÖÎöÒâ¼û£¬Ð»Ð»£¡
>
> --
> Ì쾲ɳ
>
> ------------------------------
>
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>



-- 
Guozhu Wen
guozhuwen在gmail.com
Tel. 086-0551-5591108
Fax. 086-0551-5592751
Department of Automation,
University of Science and Technology of China
and
Institute of Intelligent Machines, Chinese Academy of Sciences
P.O. Box 1130, Hefei, Anhui 230031, China
Our lab web page:
http://www.intelengine.cn
My homepage:
http://home.ustc.edu.cn/~wentrue/resume.html
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20071101/d1c7e1f0/attachment.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年11月01日 星期四 16:48

ScarletGrape Gue gue026在gmail.com
星期四 十一月 1 16:48:07 HKT 2007

Èç¹ûÖ»ÐèҪһС²¿·ÖÊý¾ÝµÄ»°,¿ÉÒÔÊÔÊÔʹÓÃÕýÔò±í´ïʽÀ´Íê³É..

On 11/1/07, wentrue(I'm Once) <guozhuwen在gmail.com> wrote:
>
> ÎÒʹÓÃSGMLLIBʱ¾­³£ÓÐÒ»¸öÀ§»ó£¬¾ÍÊÇfeedµÄ¹ý³ÌÄܲ»ÄÜÌáÇ°ÖÕÖ¹£¬±ÈÈçÄãµÄ³ÌÐòÀÎÒÖ»ÊÇÏ£ÍûµÃµ½µÚÒ»¸öÁ´½ÓµØÖ·£¬
> ÔÚhandle_dataÖеõ½µÚÒ»¸öÓÐÓÃÊý¾Ýºó£¬¾ÍÏ£ÍûÍ˳öfeed£¬¶ø²»ÊÇÿ´Î¶¼Õû¸öÎļþ¶¼½âÊÍÍ꣬ÄǸÃÔõô´¦Àí£¿
>
> ÔÚ07-11-1£¬hechu < hcpython在gmail.com> дµÀ£º
> >
> >  ÄãÁ½¸ö¶¼ÊÔÊÔ£¬¾ÍÃ÷°×ÁË¡£8ÔÂÎÒд¹ýÒ»¸öÍøÒ³·ÖÎöµÄ¶«¶«£¬Á½¸öÄ£¿é¶¼³¢ÊÔºó£¬ÎÒÑ¡ÔñÁË SGMLLIB¡£
> > ÏÖÔÚÍü¼Çϸ½ÚÁË£¬ºÃÏñ¾õµÃSGMLLIB±àд¸ü·½±ã£¬¸üÊʺÏÎÒµ±Ê±×öµÄÒ³Ãæ·ÖÎö¹¤×÷¡£
> >
> > ·Ï»°²»Ëµ£¬ÉÏ´úÂ룡µ±È»ÊǾ«¼ò¹ýµÄ´úÂ룬¾­²âÊÔ¿ÉÒÔÔËÐС£
> > ÏÂÃæ´úÂëÑÝʾÁË´Ó°Ù¶Èmp3ËÑË÷Ò³ÃæÖÐËÑË÷µ½Ä³Ê׸èÇúºó£¬¸ù¾Ý¸èÊÖÃûºÍ¸èÇúÃû£¬·ÖÎöÕÒµ½¸Ã¸èÇúµÄÊÔÌýµØÖ·¡£
> > ÕâÖÖÊÂÇ飬Ïë±ØÁбíÖеĺܶà´óÀж¼×ö¹ý°É¡£
> >
> > code:
> >   #!/usr/bin/env python
> > # -*- coding: cp936 -*-
> >
> > import sys
> > import socket
> > import urllib
> > import urllib2
> > import httplib
> > import threading
> > import time
> > import string
> > import logging
> > import sgmllib
> > import cookielib
> > import win32com.client
> > # from adoconstants import *
> >
> >
> > class ListParser(sgmllib.SGMLParser):
> >     def __init__(self, song, singer, sid=0, verbose=0):
> >         self.song = song
> >         self.singer = singer
> >         sgmllib.SGMLParser.__init__(self, verbose)
> >
> >     def reset(self):
> >         sgmllib.SGMLParser.reset(self)
> >         self.is_url = False
> >         self.current_singer = ""
> >         self.url = ""
> >         self.urls = []
> >
> >     def handle_data(self, data):
> >         if self.is_url:
> >             if self.url.find("http://mp3.baidu.com/singerlist/">)
> > != -1:
> >                 self.current_singer = data
> >                 #print "----------------------"
> >             if data == r"ÊÔÌý":
> >                 # print self.url
> >                 if self.singer != "":
> >                     if self.current_singer == self.singer:
> >                         self.urls.append(self.url)
> >                 else:
> >                     self.urls.append(self.url)
> >
> >     def start_a(self, attrs):
> >         #print "start tag "
> >         for k, v in attrs:
> >             if k == "href":
> >                 href = v
> >         if href:
> >             self.is_url = True
> >             self.url = href
> >
> >     def end_a(self):
> >         self.is_url = False
> >
> >     def close(self):
> >         sgmllib.SGMLParser.close(self)
> >
> >
> > def test1(args = None):
> >     url = "%s%s"%("http://mp3.baidu.com/m?f=ms&rn;=&tn;=baidump3&ct;=134217728"
> > <http://mp3.baidu.com/m?f=ms&rn;=&tn;=baidump3&ct;=134217728>,
> >
> > "&word;=%CD%B4%B3%B9%D0%C4%EC%E9+%BD%AA%D3%F1%D1%F4&lm;=-1")
> >     page = urllib2.urlopen(url)
> >     data = page.read()
> >     x = ListParser(r"Í´³¹ÐÄìé", r"½ªÓñÑô")
> >     x.feed(data)
> >     x.close()
> >     for url in x.urls:
> >         print "%s\r\n"%url
> >         pass
> >
> > if __name__ == "__main__":
> >     test1()
> >
> > aaron дµÀ:
> >
> >
> > ÏÈÉùÃ÷£¬ÎÒÊÇÒ»¸öÐÂÊÖ£¬¸Õ½Ó´¥Python²»µ½Ò»¸öÔ£¬ÒªÀûÓÃPython×öÒ»¸öÀàËÆËÑË÷ÒýÇæÈ»ºóÊý¾Ý¿â·ÖÎöµÄ¹¤¾ß¡£½ñÌìÓöµ½Ò»¸öÎÊÌ⣬µÚÒ»´Î·¢ÎÄÇë½Ì£¬»¹Çë´ó¼Ò¶à¶à°üº­£¡:)
> >
> > ¿´Ò»°ãµÄpythonÈëÃŵÄÊ鼮ʱ½éÉÜʹÓÃHTMLParserÄ£¿éÀ´·ÖÎöHTMLÒ³Ã棬¿ÉÊÇ"Dive Into
> > Python"ÄDZ¾ÊéÀïÈ´ÊÇʹÓÃSGMLParserÄ£¿éÀ´·ÖÎö£¬²»ÖªµÀÁ½ÕßÓÐʲôÇø±ð£¬ÎÒÒ²×Ô¼ºÊÔ×ÅËÑË÷ÁËһϣ¬Ã»ÓÐÕÒµ½±È½ÏÃ÷È·ÉîÈëÒ»µãµÄ·ÖÎö¡£Ö»ÊǾõµÃSGMLParserÓÐÒ»¸ö¹¦ÄÜ¿´ÉÏȥͦ"ÉñÆæ"µÄ£¬¾ÍÊÇÀýÈçÓöµ½¿ÉÒÔÖ±½Óµ÷ÓÃstart_a·½·¨£¬¶øHTMLParserÀïÃ滹ҪÓÐÒ»¾ä"if
> > tag == 'a':"µÄÅжϡ£µ«ÊÇÒ²¿´µ½Ä³Ð©ÈËÆÀÂÛ˵×öHTMLÒ³Ãæ·ÖÎö×îºÃ»¹ÊÇÓÃHTMLParser£¬²»ÖªµÀÓÐʲôµÀÀí¡£
> > ÁíÍ⣬HTMLParserËƺõÒ²ÓÐÁ½¸ö£¬Ò»¸öÊÇHTMLParserÀïÃæµÄ£¬Ò»¸öÊÇhtmllibÀïÃæµÄ£»¶øSGMLParserÊÇ
> > sgmllibÀïÃæµÄ¡£
> > Çë´ó¼Ò¸øµã·ÖÎöÒâ¼û£¬Ð»Ð»£¡
> >
> > --
> > Ì쾲ɳ
> >
> > ------------------------------
> >
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese在lists.python.cn
> > Subscribe: send subscribe to python-chinese-request在lists.python.cn
> > Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> >
> >
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese在lists.python.cn
> > Subscribe: send subscribe to python-chinese-request在lists.python.cn
> > Unsubscribe: send unsubscribe to
> > python-chinese-request在lists.python.cn
> > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> >
>
>
>
> --
> Guozhu Wen
> guozhuwen在gmail.com
> Tel. 086-0551-5591108
> Fax. 086-0551-5592751
> Department of Automation,
> University of Science and Technology of China
> and
> Institute of Intelligent Machines, Chinese Academy of Sciences
> P.O. Box 1130, Hefei, Anhui 230031, China
> Our lab web page:
> http://www.intelengine.cn
> My homepage:
> http://home.ustc.edu.cn/~wentrue/resume.html
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20071101/574205bc/attachment.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年11月01日 星期四 17:32

Shao Feng sevenever在gmail.com
星期四 十一月 1 17:32:20 HKT 2007

对不起,请问你们在Gmail中贴成有背景色的代码是怎么做的啊?
是用一句

code:
吗?

On 11/1/07, ScarletGrape Gue <gue026在gmail.com> wrote:
>
> 如果只需要一小部分数据的话,可以试试使用正则表达式来完成..
>
> On 11/1/07, wentrue(I'm Once) <guozhuwen在gmail.com> wrote:
>
> > 我使用SGMLLIB时经常有一个困惑,就是feed的过程能不能提前终止,比如你的程序里,我只是希望得到第一个链接地址,
> > 在handle_data中得到第一个有用数据后,就希望退出feed,而不是每次都整个文件都解释完,那该怎么处理?
> >
> > 在07-11-1,hechu < hcpython在gmail.com > 写道:
> >
> > >  你两个都试试,就明白了。8月我写过一个网页分析的东东,两个模块都尝试后,我选择了 SGMLLIB。
> > > 现在忘记细节了,好像觉得SGMLLIB编写更方便,更适合我当时做的页面分析工作。
> > >
> > > 废话不说,上代码!当然是精简过的代码,经测试可以运行。
> > > 下面代码演示了从百度mp3搜索页面中搜索到某首歌曲后,根据歌手名和歌曲名,分析找到该歌曲的试听地址。
> > > 这种事情,想必列表中的很多大佬都做过吧。
> > >
> > > code:
> > >   #!/usr/bin/env python
> > > # -*- coding: cp936 -*-
> > >
> > > import sys
> > > import socket
> > > import urllib
> > > import urllib2
> > > import httplib
> > > import threading
> > > import time
> > > import string
> > > import logging
> > > import sgmllib
> > > import cookielib
> > > import win32com.client
> > > # from adoconstants import *
> > >
> > >
> > > class ListParser(sgmllib.SGMLParser):
> > >     def __init__(self, song, singer, sid=0, verbose=0):
> > >         self.song = song
> > >         self.singer = singer
> > >         sgmllib.SGMLParser.__init__(self, verbose)
> > >
> > >     def reset(self):
> > >         sgmllib.SGMLParser.reset(self)
> > >         self.is_url = False
> > >         self.current_singer = ""
> > >         self.url = ""
> > >         self.urls = []
> > >
> > >     def handle_data(self, data):
> > >         if self.is_url:
> > >             if self.url.find( "http://mp3.baidu.com/singerlist/">)
> > > != -1:
> > >                 self.current_singer = data
> > >                 #print "----------------------"
> > >             if data == r"试听":
> > >                 # print self.url
> > >                 if self.singer != "":
> > >                     if self.current_singer == self.singer:
> > >                         self.urls.append(self.url)
> > >                 else:
> > >                     self.urls.append(self.url)
> > >
> > >     def start_a(self, attrs):
> > >         #print "start tag "
> > >         for k, v in attrs:
> > >             if k == "href":
> > >                 href = v
> > >         if href:
> > >             self.is_url = True
> > >             self.url = href
> > >
> > >     def end_a(self):
> > >         self.is_url = False
> > >
> > >     def close(self):
> > >         sgmllib.SGMLParser.close(self)
> > >
> > >
> > > def test1(args = None):
> > >     url = "%s%s"%("http://mp3.baidu.com/m?f=ms&rn;=&tn;=baidump3&ct;=134217728"
> > > <http://mp3.baidu.com/m?f=ms&rn;=&tn;=baidump3&ct;=134217728>,
> > >
> > > "&word;=%CD%B4%B3%B9%D0%C4%EC%E9+%BD%AA%D3%F1%D1%F4&lm;=-1")
> > >     page = urllib2.urlopen(url)
> > >     data = page.read()
> > >     x = ListParser(r"痛彻心扉", r"姜玉阳")
> > >     x.feed(data)
> > >     x.close()
> > >     for url in x.urls:
> > >         print "%s\r\n"%url
> > >         pass
> > >
> > > if __name__ == "__main__":
> > >     test1()
> > >
> > > aaron 写道:
> > >
> > >
> > > 先声明,我是一个新手,刚接触Python不到一个月,要利用Python做一个类似搜索引擎然后数据库分析的工具。今天遇到一个问题,第一次发文请教,还请大家多多包涵!:)
> > >
> > > 看一般的python入门的书籍时介绍使用HTMLParser模块来分析HTML页面,可是"Dive Into
> > > Python"那本书里却是使用SGMLParser模块来分析,不知道两者有什么区别,我也自己试着搜索了一下,没有找到比较明确深入一点的分析。只是觉得SGMLParser有一个功能看上去挺"神奇"的,就是例如遇到可以直接调用start_a方法,而HTMLParser里面还要有一句"if
> > > tag == 'a':"的判断。但是也看到某些人评论说做HTML页面分析最好还是用HTMLParser,不知道有什么道理。
> > > 另外,HTMLParser似乎也有两个,一个是HTMLParser里面的,一个是htmllib里面的;而SGMLParser是
> > > sgmllib里面的。
> > > 请大家给点分析意见,谢谢!
> > >
> > > --
> > > 天静沙
> > >
> > > ------------------------------
> > >
> > > _______________________________________________
> > > python-chinese
> > > Post: send python-chinese在lists.python.cn
> > >
> > > Subscribe: send subscribe to python-chinese-request在lists.python.cn
> > > Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> > > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> > >
> > >
> > > _______________________________________________
> > > python-chinese
> > > Post: send python-chinese在lists.python.cn
> > > Subscribe: send subscribe to python-chinese-request在lists.python.cn
> > > Unsubscribe: send unsubscribe to
> > > python-chinese-request在lists.python.cn
> > > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> > >
> >
> >
> >
> > --
> > Guozhu Wen
> > guozhuwen在gmail.com
> > Tel. 086-0551-5591108
> > Fax. 086-0551-5592751
> > Department of Automation,
> > University of Science and Technology of China
> > and
> > Institute of Intelligent Machines, Chinese Academy of Sciences
> > P.O. Box 1130, Hefei, Anhui 230031, China
> > Our lab web page:
> > http://www.intelengine.cn
> > My homepage:
> > http://home.ustc.edu.cn/~wentrue/resume.html>
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese在lists.python.cn
> > Subscribe: send subscribe to python-chinese-request在lists.python.cn
> > Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> >
> > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> >
>
>
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
-------------- 下一部分 --------------
一个HTML附件被移除...
URL: http://python.cn/pipermail/python-chinese/attachments/20071101/3c5c1344/attachment.html 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年11月01日 星期四 17:37

limodou limodou在gmail.com
星期四 十一月 1 17:37:20 HKT 2007

On 11/1/07, Shao Feng <sevenever在gmail.com> wrote:
>
> ¶Ô²»Æð£¬ÇëÎÊÄãÃÇÔÚGmailÖÐÌù³ÉÓб³¾°É«µÄ´úÂëÊÇÔõô×öµÄ°¡£¿
> ÊÇÓÃÒ»¾ä
>
>
Ñ¡Öкó¸Äһϱ³¾°É«²»ÐÐÂð£¿


-- 
I like python!
UliPad <>: http://code.google.com/p/ulipad/
meide <>: http://code.google.com/p/meide/
My Blog: http://www.donews.net/limodou
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20071101/0f95d3a5/attachment.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年11月01日 星期四 17:44

hechu hcpython在gmail.com
星期四 十一月 1 17:44:07 HKT 2007

一个HTML附件被移除...
URL: http://python.cn/pipermail/python-chinese/attachments/20071101/5563a6f9/attachment.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2007年11月02日 星期五 00:33

Shao Feng sevenever在gmail.com
星期五 十一月 2 00:33:55 HKT 2007

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

哦,我搞错了。还以为Gmail支持某种特殊的Tag,可以输个code后面的部分自动保持代码格式。
正纳闷有个"code"开始,没有结束标记呢。
原来是hechu自己编辑的背景呀。

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHKgCEql7DMwJyP/YRAiKTAKCaV6FdyvhxmVSbGCWhE7chNj4LOQCgvE1v
OXt/QI07zIhrJnKVuDu0BTA=
=oQ+4
-----END PGP SIGNATURE-----
On 11/1/07, limodou <limodou在gmail.com> wrote:
>
> On 11/1/07, Shao Feng <sevenever在gmail.com> wrote:
> >
> > 对不起,请问你们在Gmail中贴成有背景色的代码是怎么做的啊?
> > 是用一句
> >
> >
> 选中后改一下背景色不行吗?
>
>
> --
> I like python!
> UliPad <>: http://code.google.com/p/ulipad/
> meide <>: http://code.google.com/p/meide/
> My Blog: http://www.donews.net/limodou
>
> _______________________________________________
> python-chinese
> Post: send python-chinese在lists.python.cn
> Subscribe: send subscribe to python-chinese-request在lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request在lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
-------------- 下一部分 --------------
一个HTML附件被移除...
URL: http://python.cn/pipermail/python-chinese/attachments/20071102/ca689dd3/attachment.htm 

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号