- 博客(13)
- 收藏
- 关注
原创 Scrapy 安装全过程(在windows的python3中)
在python3中安装Scrapy需要先安装lxml、pyOpenSSL、Twisted等。首先直接在cmd中用pip install XXX来安装,若是无法安装就去下面这个网站搜索(ctrl+f)到lxml、OpenSSL、Twisted、Scrapy的whl文件并下载下来 http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml在cmd中定位到所下载的文件
2017-02-25 16:15:27
478
原创 pyc11
from PIL import Image,ImageDrawimg=Image.open('cave.jpg')img1=Image.new('RGB',(640,480))for x in range(1,640): for y in range(1,480): img_pixel=img.getpixel((x,y)) img1.putpixel((x
2017-02-22 11:11:33
207
原创 pyc10
import rea='1'for i in range(30): b=re.findall('(1+|2+|3+)',a) a=''.join([str(len(j))+j[0] for j in b]) print(len(a))
2017-02-22 10:51:04
267
原创 pyc9
from PIL import ImageDraw,Imagefirst=[146,399,163,403,170,393,169,391,166,386,170,381,170,371,170,355,169,346,167,335,170,329,170,320,170,310,171,301,173,290,178,289,182,287,188,286,190,286,192,291,19
2017-02-21 10:46:12
285
原创 pyc8
import bz2username=b'BZh91AY&SYA\xaf\x82\r\x00\x00\x01\x01\x80\x02\xc0\x02\x00 \x00!\x9ah3M\x07<]\xc9\x14\xe1BA\x06\xbe\x084'password=b'BZh91AY&SY\x94$|\x0e\x00\x00\x00\x81\x00\x03$ \x00!\x9ah3M\x13<]
2017-02-21 09:46:45
323
原创 pyc7
from PIL import Imageimport reimg=Image.open('oxygen.png')print(img.format,img.size,img.mode)for x in range(img.size[0]): for y in range(img.size[1]): print(img.getpixel((x,y)))#观察特点'''
2017-02-20 17:21:48
292
原创 pyc6
import zipfile,reopen_zip=zipfile.ZipFile('channel.zip','r')#在网页源代码里看到zip,打开网址下载channel.zip并放在代码文件母录下。next_id='90052.txt'count=1while True: data=open_zip.read(next_id) data=str(data,encoding=
2017-02-19 11:38:36
197
原创 pyc5
import picklefile=open('banner.p','rb') #将banner.p文件保存至此py文件所在的目录下。data=pickle.load(file)print(data)str1=''for list in data: print(list) for i in list: str1+=i[0]*i[1] str1+='\n'pr
2017-02-19 11:05:37
349
原创 pyc4
import urllib.request,resrc='http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=12345'url='http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing='count=0while True: nexturl=urlli
2017-02-19 11:02:04
231
原创 pyc3
str1='''字符串'''import re result=re.findall(r'[a-z][A-Z]{3}[a-z][A-Z]{3}[a-z]',str1)print(result)
2017-02-19 10:20:16
219
原创 pyc2
import restr1='''此处加入网页源代码中的字符串''''''#其中一种方法list1=[]key=[]for i in str1: list1.append(i) if i not in key: key.append(i)for each in key: print(each,list1.count(each))'''print(r
2017-02-19 10:16:53
362
原创 pyc1
list1=['m','a','p']list2=[]for i in range(3): list2.append(chr(ord(list1[i])+2))print(list2)
2017-02-19 10:11:58
246
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人