Python Challenge (level 7)

URI: http://www.pythonchallenge.com/pc/def/oxygen.html

说明:
PNG文件有一条不寻常的灰色条,答案就隐藏在里面
这题要用 Python Imaging Library (PIL)的Image模块 http://www.pythonware.com/products/pil/

解题方法:
import re, Image

i = Image.open("oxygen.png") # http://www.pythonchallenge.com/pc/def/oxygen.png
row = [i.getpixel((x, 45)) for x in range(0, i.size[0], 7)]
ords = [r for r, g, b, a in row if r == g == b]

print "".join(map(chr, map(int, re.findall("\d+", "".join(map(chr, ords))))))


过关答案:
integrity

你可能感兴趣的:(html,python)