ÎÒÏÖÔÚÓÐÒ»¸öÕâÑùµÄ×Ö·û´®str1="http://hi.baidu.com/rubylang/blog/item/1661ad50d600c46784352445.html#/html/body/table[1]/tr/td"
Ôõôдһ¸ö±í´ïʽÀ´Æ¥ÅäËü£¬ÐèÒªpythonÓïÑÔ£¬²¢ÇÒÄܹ»°Ñ
http://hi.baidu.com/rubylang/blog/item/1661ad50d600c46784352445.html£¬¸ú/html/body/table[1]/tr/tdÌáÈ¡³öÀ´ ......
RT:
ץȡÍøÒ³ÄÚÈÝʱÈçºÎ½«htmlת»»³Éxml?
3Q.
ÕÒµ½Õâ¶Î´úÂ룺
#!/usr/bin/python
import sys from xml.dom
import core from xml.dom.html_builder
import HtmlBuilder
b = HtmlBuilder()
b.feed(sys.stdin.read())
doc = b.document
print doc.toxml()
²»¹ýϵͳÀïûÓÐhtm ......
´øclassµÄpython³ÌÐòÊÇÔõÑùÖ´ÐеÄ?
Èç
#!/usr/bin/python
import sgmllib,urllib
class MyParser(sgmllib.SGMLParser):
"A simple parser class."
def parse(self, s):
"Parse the given string 's'." ......
RT
python:ÈçºÎÒýÓÃÀàÖеıäÁ¿£¿
¶¨ÒåÁËÒ»¸öclass£¬Óиö±äÁ¿data£¬ÊÇ´¦ÀíºóµÃµ½µÄÊý¾Ý£¬ÎÒÏëÔÚͬһÎļþÖеÄÆäËüµØ·½ÒýÓôËÎļþ£¿Ò»°ãÓÐʲô°ì·¨£¿
obj.data
¶¨ÒåÁËÒ»¸öÈ«¾Ö±äÁ¿£¬global a
ÔÚmainÀォa¸³Öµ£¬È»ºóÔÚclassÀïÒýÓÃa,Ìáʾa䶨Ò壿
Çë¸ßÈ˴ͽ̡£
¸³ÖµÇ°ÉùÃ÷Ï£º
global a
......
³ÌÐò½á¹¹ÈçÏ£º
#¶¨ÒåÁËÈ«¾Ö±äÁ¿A
A=0
#class´¦ÀíA
class b
global A
A
#mainÀï¸øA¸³Öµ
A = 1
³ÌÐòÖ´ÐÐʱ·¢ÏÖclassÀïAµÄÖµ»¹ÊÇ0
ÐÂÊÖÓм¸¸öÎÊÌ⣺
1¡¢python³ÌÐòÖ´ÐеÄ˳Ðò£¬Èç±¾Àý,ÓÉÖ´Ðнá¹û¿´£¬ÊÇ˳ÐòÖ´ÐУ¿
2 ......
ѧϰpythonµÄ7±¾Êé
°üÀ¨6±¾chm£¬Ò»±¾pdf×ÊÁÏ
¶ÔѧϰpythonÓкܴóµÄ°ïÖú
http://download.csdn.net/source/619791
¾«ÐÄËѼ¯£¬²»Òª»ý·Ö£¬ÄóöÀ´·ÖÏí
лл¥Ö÷£¬ÐÁ¿àÁË~
lz ×îºÃ°ÑÊéÃûºÍ¼òµ¥½éÉܼÓÉÏ
²»È»¡°¾«ÐÄ¡±Óеã¶Ô²»ÉÏ
lzºÃÈË¡£
Ïȶ¥ÔÙÏ¡£ºÇºÇ
ËäÈ»ÎÒÈ«¶¼ÓУ¬µ«»¹ÊÇÒªÔÞÒ»¸ö£¡
Â¥Ö÷Ì«º ......