Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÕýÔò±í´ïʽÓëpython

 ÔÚPythonÖÐÓÐÒ»¸ö·Ç³£ÖØÒªÒ²·Ç³£ºÃÓõÄÄ£¿ére£¬ÔÚimport reºó£¬¾ÍÄܹ»ÔÚPythonÖÐʹÓÃÕýÔò±í´ïʽ£¬Ô´ÓÚ´Ë´ÎÏîĿҪÓÃÕýÔò±í´ïʽ¶Ôhtml´úÂëÌáȡһ¶¨µÄ×Ö·û£¬ËùÒÔÔÚÕâÒ²¾ÍÓÃЩСÀý×ÓÀ´ÊìϤһÏÂÕýÔò±í´ïʽ
ÏÖÔÚ¾ÍÓÃ×î¼òµ¥µÄÀý×Ó
import re
s='<title>http://www.baidu.com</title>'
print re.findall(r'<\w+>(.+)</',s)
ÔËÐкó½á¹ûΪ
>>>
['http:\\www.baidu.com']
Õâ¸öÏà¶ÔÀ´Ëµ»¹ÊDZȽϼòµ¥µÄ£¬µ«ÊÇÕâ¸öÕýÔò±í´ïʽ»¹ÊÇÓбȽ϶àµÄÎÊÌâ
1¶ÔÓڱȽϸ´ÔÓµÄ×Ö·û´®£¬±ÈÈçǶÌ×Á˱êÇ©µÄ×Ö·û´®£¬¾ÍûÓа취ÁË£¬ÒòΪֻÄܹ»ÅжÏ×îÍâÒ»²ãµÄ<></>±ê¼Ç¶øÒÑ
2ÊÇÕâ¸öÊÇÅжϾßÓÐÀàËÆ<></>±ê¼ÇµÄ×Ö·û´®£¬¶ÔÓÚʵ¼ÊµÄhtmlÖеÄÌáÈ¡£¬»¹ÊÇÒª¼ÓÉϾßÌåµÄÖµ£¬±ÈÈçÊÇtitle£¬»¹ÊÇhead
import re
s='<head><title>http:\\www.baidu.com</title></head>'
print re.findall(r'title>(.+)</title',s)
ÔËÐкóµÃµ½
>>>
['http:\\www.baidu.com']
ËäÈ»ÔÚÕâ¸ö±È½Ï¼òµ¥µÄ´úÂëÖÐÎÒÃǽâ¾öÁËÉÏÊöÁ½¸öÎÊÌ⣬µ«ÊÇÕë¶ÔhtmlÖиü¼Ó¸´ÔӵĴúÂ룬ÎÒ¾õµÃ»¹ÊÇ»áÓкܶàµÄÎÊÌâ
²»¹ý½ñÌìÒ²¾ÍÊǼòµ¥µÄÊìϤһÏÂÕýÔò±í´ïʽ£¬ËùÒÔÒ²¾Í²»ÔÙÈ¥ÉîÈëÑо¿£¬¾­¹ý¶ÓÔ±µÄÌÖÂÛºóÔÚ̽ÌÖ½â¾öÎÊÌâµÄ·½°¸
ÏÂÃæ¸ø³öÒ»¸öÅжÏÓÊÏ䵨ַÊÇ·ñºÏ·¨µÄÕýÔò±í´ïʽ
ÓÊÏäÖ÷Òª°üÀ¨@ºÍ.£¬ËùÒÔÔÚÅжϵÄʱºòÒ²Ö»Ðè¼ÙÈçÕâÁ½¸öÌõ¼þ¾Í¿ÉÒÔÁË
import re
s='zhuangruln@gmail.com  zhuangasdsad@126.com zhusdandsai@adsd'
print re.findall(r'(\w+@\w+\.\w+)',s)
ÔËÐнá¹û
['zhuangruln@gmail.com', 'zhuangasdsad@126.com']
>>>


Ïà¹ØÎĵµ£º

Python Ï̳߳Ø


import Queue, threading, sys
from threading import Thread
import time,urllib
# working thread
class Worker(Thread):
   worker_count = 0
   def __init__( self, workQueue, resultQueue, timeout = 0, **kwds):
       Thread.__init__( self, **kwds ) ......

python ¶íÂÞ˹·½¿é

Õâ¸öËãÊÇC++ǶÈëpython°É£¬ÀûÓÃpythonʵÏÖÏÔʾºÍʼþ´¦Àí£¬C++ʵÏÖÂß¼­
ÒÔºóÓÐʱ¼äÒ²»á·´¹ýÀ´ÊÔÊÔ£º£© 
import pygame
import sys
import os
import ctypes
def cur_file_dir():
#»ñÈ¡½Å±¾Â·¾¶
path = sys.path[0]
#ÅжÏΪ½Å±¾Îļþ»¹ÊÇpy2exe±àÒëºóµÄÎļþ£¬Èç¹ûÊǽű¾Îļþ£¬Ôò·µ»ØµÄÊǽű¾µÄĿ ......

pythonÄ£¿éÖ®poplib: ÓÃpop3ÊÕÈ¡Óʼþ

 
À´Ô´£º ×÷Õߣºzhaoweikid ·¢²¼Ê±¼ä£º2007-07-04 ÔĶÁ´ÎÊý£º
    pythonµÄpoplibÄ£¿éÊÇÓÃÀ´´Ópop3ÊÕÈ¡ÓʼþµÄ£¬Ò²¿ÉÒÔ˵ËüÊÇ´¦ÀíÓʼþµÄµÚÒ»²½¡£
    POP3ЭÒé²¢²»¸´ÔÓ£¬ËüÒ²ÊDzÉÓõÄÒ»ÎÊÒ»´ðʽµÄ·½Ê½£¬ÄãÏò·þÎñÆ÷·¢ËÍÒ»¸öÃüÁ·þÎñÆ÷±ØÈ»»á»Ø¸´Ò»¸öÐÅÏ¢¡£pop3ÃüÁîÂëÈçÏ£º
¡¡ÃüÁ ......

Python & XML


Chapter 1
Python and XML
Python and XML are two very different animals, each with a rich
history. Python is a full-scale programming language that has grown
from scripting world roots in a very organic way, through the vision
and guidance of Python's inventor, Guido van Rossum. Guido continue ......

PythonÈÕÆÚ²Ù×÷ѧϰ±Ê¼Ç

 http://www.itzn.cn/html/jiaoben/python-perl-VBA/200812/19-3283.html
×Ö·û´®ÊÇʹÓþ²Ì¬µÄ·½Ê½½øÐд洢£¬Ö»ÄܶÁ¶ø²»ÄÜÖ±½ÓÐÞ¸Ä×Ö·ûÄÚÈÝ¡£Ìرð½«Ò»¶Ñ¶Ô×Ö·û´®²¢ÔÚÒ»ÆðµÄʱºò£¬ËäÈ»¿ÉÒÔÖ±½ÓÏà¼Ó£¬Ìý˵ÕâÑùµÄËÙ¶ÈÆæÂý£¬Ö»ÓÐÓÃÆäËüº¯ÊýµÄ·½Ê½½øÐУ¬ºÃÔÚÒ²²»Ì«Âé·³¡£
±ÈÈçÓà print ','.join(datelist)
¾Í¿ÉÒÔ½«date ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ