pythonchallenge-7地址 : http://www.pythonchallenge.com/pc/def/oxygen.html
图片如下:
使用python 3.x 对pythonchallenge-----7的解答过程

题目解析:对图片中的乱码部分进行解析,得出颜色值,然后转换为字母

解题过程:
from PIL import Image
img = Image.open(r'./other/oxygen.png')
print(img.format, img.size, img.mode)

li = []
chrli = []
for i in range(629):
    data = img.getpixel((i,46))
    if data[0] == data[1] == data[2]:
        li.append(data[0])

for zzz in li[::7]:
    chrli.append(chr(zzz))

print("".join(chrli))

source = [105, 110, 116, 101, 103, 114, 105, 116, 121]
print("".join(chr(n) for n in source))

答案:integrity

smart guy, you made it. the next level is [105, 110, 116, 101, 103, 114, 105, 116, 121]
integrity

 心得:

这关使用了第三方库PIL

 
 

相关文章:

  • 2022-03-03
  • 2021-06-24
  • 2021-08-07
  • 2021-07-14
  • 2022-03-06
  • 2021-08-13
  • 2021-06-09
  • 2021-09-22
猜你喜欢
  • 2022-03-08
  • 2021-10-12
  • 2021-10-12
  • 2021-07-12
  • 2021-12-10
  • 2021-12-11
  • 2021-05-18
相关资源
相似解决方案