mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-30 09:59:50 +03:00
Small changed, using range() instead of deprecated xrange()
This commit is contained in:
parent
03c5242269
commit
acdda34589
|
@ -6,7 +6,7 @@ how to run
|
|||
|
||||
[ -d image_resources ] || mkdir image_resources
|
||||
wget http://upload.wikimedia.org/wikipedia/commons/6/69/Captcha.jpg -O image_resources/captcha.jpg
|
||||
python crop/croip.py
|
||||
python crop/crop.py
|
||||
|
||||
## Build it on Mac OS X 10.6.*
|
||||
|
||||
|
|
|
@ -22,8 +22,8 @@ def print_im(im, w=None, h=None):
|
|||
else:
|
||||
pixels = im
|
||||
|
||||
for x in xrange(w):
|
||||
for y in xrange(h):
|
||||
for x in range(w):
|
||||
for y in range(h):
|
||||
|
||||
if pixels[x, y] > 128:
|
||||
print " ",
|
||||
|
|
|
@ -23,8 +23,8 @@ im = im.draft("L", im.size)
|
|||
pixsels = im.load()
|
||||
|
||||
|
||||
for x in xrange(w):
|
||||
for y in xrange(h):
|
||||
for x in range(w):
|
||||
for y in range(h):
|
||||
if pixsels[x, y] > 128:
|
||||
pixsels[x, y] = WHITE
|
||||
else:
|
||||
|
@ -32,8 +32,8 @@ for x in xrange(w):
|
|||
|
||||
|
||||
counts = []
|
||||
for x in xrange(w):
|
||||
count = len([1 for y in xrange(h)
|
||||
for x in range(w):
|
||||
count = len([1 for y in range(h)
|
||||
if pixsels[x, y] is BLACK])
|
||||
|
||||
counts.append(count)
|
||||
|
|
Loading…
Reference in New Issue
Block a user