摘要: 使用正则表达式#! /usr/bin/env python#coding=utf-8import urllib2, rePATTERN = re.compile(r'')PATTERN2 = re.compile(r'<a href="/topics/(\d+)/"')def getNo(url): '''Get the no for each album''' fd = urlli... 阅读全文
posted @ 2011-04-05 21:41 莫忆往西 阅读(292) 评论(0) 推荐(0) 编辑
摘要: Beautiful Soup Documentation 中文文档:http://www.crummy.com/software/BeautifulSoup/documentation.zh.html#! /usr/bin/env python#coding=utf-8import mechanizefrom BeautifulSoup import BeautifulSoupdef scrap... 阅读全文
posted @ 2011-04-05 21:32 莫忆往西 阅读(391) 评论(0) 推荐(0) 编辑
摘要: # hidden statesstates = ('Rainy', 'Sunny')# observations:observations = ('walk', 'shop', 'clean')start_probability = {'Rainy':0.6, 'Sunny':0.4}transition_probability = { 'Rainy':{'Rainy':0.7, ... 阅读全文
posted @ 2011-04-05 21:24 莫忆往西 阅读(217) 评论(0) 推荐(0) 编辑