资源简介
python 网络爬虫框架scrapy的所有依赖包,可以直接使用pip安装
代码片段和文件信息
#!d:\program files (x86)\python35\python.exe
#
# The Python Imaging Library
# $Id$
#
# this demo script illustrates pasting into an already displayed
# photoimage. note that the current version of Tk updates the whole
# image every time we paste so to get decent performance we split
# the image into a set of tiles.
#
try:
from tkinter import Tk Canvas NW
except ImportError:
from Tkinter import Tk Canvas NW
from PIL import Image ImageTk
import sys
#
# painter widget
class PaintCanvas(Canvas):
def __init__(self master image):
Canvas.__init__(self master width=image.size[0] height=image.size[1])
# fill the canvas
self.tile = {}
self.tilesize = tilesize = 32
xsize ysize = image.size
for x in range(0 xsize tilesize):
for y in range(0 ysize tilesize):
box = x y min(xsize x+tilesize) min(ysize y+tilesize)
tile = ImageTk.PhotoImage(image.crop(box))
self.create_image(x y image=tile anchor=NW)
self.tile[(x y)] = box tile
self.image = image
self.bind(““ self.paint)
def paint(self event):
xy = event.x - 10 event.y - 10 event.x + 10 event.y + 10
im = self.image.crop(xy)
# process the image in some fashion
im = im.convert(“L“)
self.image.paste(im xy)
self.repair(xy)
def repair(self box):
# update canvas
dx = box[0] % self.tilesize
dy = box[1] % self.tilesize
for x in range(box[0]-dx box[2]+1 self.tilesize):
for y in range(box[1]-dy box[3]+1 self.tilesize):
try:
xy tile = self.tile[(x y)]
tile.paste(self.image.crop(xy))
except KeyError:
pass # outside the image
self.update_idletasks()
#
# main
if len(sys.argv) != 2:
print(“Usage: painter file“)
sys.exit(1)
root = Tk()
im = Image.open(sys.argv[1])
if im.mode != “RGB“:
im = im.convert(“RGB“)
PaintCanvas(root im).pack()
root.mainloop()
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 97896 2017-07-30 15:57 scrapy\asn1crypto-0.22.0-py2.py3-none-any.whl
文件 24590 2017-07-30 16:05 scrapy\attrs-17.2.0-py2.py3-none-any.whl
文件 35207 2017-07-30 16:03 scrapy\Automat-0.6.0-py2.py3-none-any.whl
文件 160867 2017-07-30 15:56 scrapy\cffi-1.10.0-cp35-cp35m-win_amd64.whl
文件 7922 2017-07-30 16:05 scrapy\constantly-15.1.0-py2.py3-none-any.whl
文件 1332201 2017-07-30 15:54 scrapy\cryptography-2.0-cp35-cp35m-win_amd64.whl
文件 15974 2017-07-30 16:10 scrapy\cssselect-1.0.1-py2.py3-none-any.whl
文件 29758 2017-07-30 16:04 scrapy\hyperli
文件 55106 2017-07-30 15:55 scrapy\idna-2.5-py2.py3-none-any.whl
文件 16667 2017-07-30 16:03 scrapy\incremental-17.5.0-py2.py3-none-any.whl
文件 3153436 2017-07-30 15:37 scrapy\lxm
文件 2135 2017-03-12 18:33 scrapy\painter.py
文件 11306 2017-07-30 16:10 scrapy\parsel-1.2.0-py2.py3-none-any.whl
文件 42622 2017-07-30 16:36 scrapy\pyasn1\codec\ber\decoder.py
文件 17970 2017-07-30 16:36 scrapy\pyasn1\codec\ber\encoder.py
文件 578 2017-07-30 16:36 scrapy\pyasn1\codec\ber\eoo.py
文件 59 2017-07-30 16:36 scrapy\pyasn1\codec\ber\__init__.py
文件 27525 2017-07-30 16:36 scrapy\pyasn1\codec\ber\__pycache__\decoder.cpython-35.pyc
文件 13970 2017-07-30 16:36 scrapy\pyasn1\codec\ber\__pycache__\encoder.cpython-35.pyc
文件 791 2017-07-30 16:36 scrapy\pyasn1\codec\ber\__pycache__\eoo.cpython-35.pyc
文件 174 2017-07-30 16:36 scrapy\pyasn1\codec\ber\__pycache__\__init__.cpython-35.pyc
文件 3038 2017-07-30 16:36 scrapy\pyasn1\codec\cer\decoder.py
文件 6368 2017-07-30 16:36 scrapy\pyasn1\codec\cer\encoder.py
文件 59 2017-07-30 16:36 scrapy\pyasn1\codec\cer\__init__.py
文件 1749 2017-07-30 16:36 scrapy\pyasn1\codec\cer\__pycache__\decoder.cpython-35.pyc
文件 5448 2017-07-30 16:36 scrapy\pyasn1\codec\cer\__pycache__\encoder.cpython-35.pyc
文件 174 2017-07-30 16:36 scrapy\pyasn1\codec\cer\__pycache__\__init__.cpython-35.pyc
文件 2110 2017-07-30 16:36 scrapy\pyasn1\codec\der\decoder.py
文件 2639 2017-07-30 16:36 scrapy\pyasn1\codec\der\encoder.py
文件 59 2017-07-30 16:36 scrapy\pyasn1\codec\der\__init__.py
............此处省略159个文件信息
- 上一篇:Python-2.7.13安装包
- 下一篇:Python机器学习算法
相关资源
- Python机器学习算法
- Python-2.7.13安装包
-
廖雪峰 Git ja
vasc ript Python 3 Python - python_红心大战游戏源代码_满分原创作
- Flask Web开发:基于Python的Web应用开发
- python3.7.3-官方文档指南中文
- python2.7.2 zip
- Mastering Python Networking 2nd Edition
- Learning Jupyter 5 2nd Edition
- Python数据处理 中文完整清晰版 PDF
- Python金融大数据分析.源码.py4fi-maste
- python网络爬虫电子书
- python-3.1.1.msi
- Python机器学习基础教程(完整高清
- Learning Python 5th Edition.pdf
- 流畅的python中文版高清完整版mobi
- Python项目开发实战第2版带书签超清
- deep learning with python 中文版的
- 卷积神经网络预测
- Automate the Boring Stuff with Python 原版PD
- python2.7 32位
- 精通Python自然语言处理
- Python深度学习(中文版) 超清带书签
- 人脸识别python实现源码功能丰富
- Python机器学习
- numpy-1.17.4-cp38-cp38-win_amd64.whl
- 源码python数据挖掘入门与实践源码
- Python数据科学手册(PDF)
- Python测试驱动开发:使用Django、Sele
- Python Data Analytics 无水印pdf 0分
评论
共有 条评论