Error in user YAML: (<unknown>): found character that cannot start any token while scanning for the next token at line 2 column 1
---
# Python 简介
@su27 and @menghan
----
高级
-
易学易读易维护
| # -*- coding: utf-8 -*- | |
| #--------------------------------------- | |
| # 程序:点点美女图片爬虫 | |
| # 版本:0.2 | |
| # 作者:zippera | |
| # 日期:2013-07-26 | |
| # 语言:Python 2.7 | |
| # 说明:能设置下载的页数 |
| from urllib2 import urlopen, URLError | |
| from urllib import urlretrieve | |
| import threading | |
| import re | |
| import os | |
| downroot = r'D:\luguan' | |
| p1 = re.compile(r'src="img.+jpg') | |
| p2 = re.compile(r'\d{1,}\.jpg') | |
| prefix = 'http://www.lu-guan.com/xxoo/' |
| # coding: utf-8 | |
| import urllib2 | |
| import urllib | |
| import re | |
| pat = re.compile(r'<div.*?class="content".*?ti.*?>(.*?)</div>', re.S)#有问题 | |
| nexturl1 = "http://www.qiushibaike.com/month/page/" |
| #encoding=utf-8 | |
| import requests as rq | |
| from bs4 import BeautifulSoup as bs | |
| lgurl = 'http://mlook.mobi/member/login' | |
| host = 'http://mlook.mobi' | |
| tmpurl = 'http://mlook.mobi/book/info/6248' | |
| hds = { 'User-Agent' : 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36', | |
| 'Referer':'http://mlook.mobi/member/login', |
| #coding=utf-8 | |
| ##版本:1.0 | |
| ##环境:python2.7 | |
| ##作者:moxie | |
| ##日期:2013.08.18 | |
| ##第三方依赖:requests和BeautifulSoup4 | |
| import re | |
| import requests as rq |
| #coding=utf8 | |
| ##版本:1.0 | |
| ##环境:python2.7 | |
| ##作者:moxie | |
| ##日期:2013.08.20 | |
| import urllib2 | |
| import re | |
| import threading |
| #coding=utf8 | |
| ##版本:1.0 | |
| ##环境:python2.7 | |
| ##作者:moxie | |
| ##日期:2013.08.23 | |
| ##说明:文件生成目录为:D:/ludatui | |
| import urllib2,urllib | |
| import re |
| #Newbie programmer | |
| def factorial(x): | |
| if x == 0: | |
| return 1 | |
| else: | |
| return x * factorial(x - 1) | |
| print factorial(6) | |
| #First year programmer, studied Pascal |
| #!/usr/bin/env python | |
| #coding=utf-8 | |
| import os | |
| from numpy import array | |
| from scipy.cluster.vq import vq, kmeans, whiten, kmeans2 | |
| from sklearn import svm | |
| from sklearn import cross_validation | |
| ncluster = 6 #聚类数 | |
| ######## |