pythonchallenge Level 7

第7关地址:http://www.pythonchallenge.com/pc/def/oxygen.html

发现图片中间有一条灰色的,取出像素点颜色,发现RGB都是一样的。

把R值当成ASCII转成字符,得到一段文本,每个字符重复七次左右

sssssmmmmmmmaaaaaaarrrrrrrttttttt ggggggguuuuuuuyyyyyyy,,,,,,, yyyyyyyooooooouuuuuuu mmmmmmmaaaaaaadddddddeeeeeee iiiiiiittttttt....... ttttttthhhhhhheeeeeee nnnnnnneeeeeeexxxxxxxttttttt llllllleeeeeeevvvvvvveeeeeeelllllll iiiiiiisssssss [[[[[[[111111100000005555555,,,,,,, 111111111111110000000,,,,,,, 111111111111116666666,,,,,,, 111111100000001111111,,,,,,, 111111100000003333333,,,,,,, 111111111111114444444,,,,,,, 111111100000005555555,,,,,,, 111111111111116666666,,,,,,, 111111122222221111111]]]]]]]]

from PIL import Image

im = Image.open("oxygen.png")
(width, height) = im.size
str_x = [""]
for i in range(0,width):
    pos = (i,height/2) # 灰色条在中间位置
    pixel = im.getpixel(pos) # 获取像素点颜色
    str_x.append(chr(pixel[0])) # ascii码转字符

result = "".join(str_x)[::7] # 发现字母重复7次左右,隔7次取一次值
print(result)

隔7次取值,得到提示信息:

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

把 [105, 110, 116, 101, 103, 114, 105, 116, 121]转字符

print(''.join(map(chr,[105, 110, 116, 101, 103, 114, 105, 116, 121])))

得到 integrity

获得下一关地址:http://www.pythonchallenge.com/pc/def/integrity.html

posted @ 2021-12-07 09:54  OTAKU_nicole  阅读(55)  评论(0编辑  收藏  举报