摘要:
使用正则表达式#! /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... 阅读全文
摘要:
Beautiful Soup Documentation 中文文档:http://www.crummy.com/software/BeautifulSoup/documentation.zh.html#! /usr/bin/env python#coding=utf-8import mechanizefrom BeautifulSoup import BeautifulSoupdef scrap... 阅读全文
摘要:
# hidden statesstates = ('Rainy', 'Sunny')# observations:observations = ('walk', 'shop', 'clean')start_probability = {'Rainy':0.6, 'Sunny':0.4}transition_probability = { 'Rainy':{'Rainy':0.7, ... 阅读全文