pythonchallenge Level 30
第30关地址:http://www.pythonchallenge.com/pc/ring/yankeedoodle.html
用户名:repeat 密码:switch
查看源码
标题:relax you are on 30
提示:The picture is only meant to help you relax
while you look at the csv file
打开:https://www.pythonchallenge.com/pc/ring/yankeedoodle.csv 得到一个下载文件yankeedoodle.csv
from PIL import Image with open('yankeedoodle.csv') as f: data = [d.strip() for d in f.read().split(',')] print(len(data)) # 7367 img = Image.new('F',(53,139)) img.putdata([float(d) for d in data],scale=200) img = img.transpose(Image.FLIP_LEFT_RIGHT) # 左右翻转 img = img.transpose(Image.ROTATE_90) # 转90度 img.save("yankeedoodle.gif")
把数字写入一张图
得到一个公式:n = str(x[i])[5]+str(x[i+1])[5]+str(x[i+2])[6]
继续处理数字,3个一组按照公式计算
s = [chr(int(data[i][5]+data[i+1][5]+data[i+2][6]))for i in range(0,len(data)-2,3)] print(''.join(s))
得到提示信息:
So, you found the hidden message.
There is lots of room here for a long message, but we only need very little space to say "look at grandpa", so the rest is just garbage.
获得下一关地址:http://www.pythonchallenge.com/pc/ring/grandpa.html
用户名:repeat 密码:switch
本文来自博客园,作者:OTAKU_nicole,转载请注明原文链接:https://www.cnblogs.com/nicole-zhang/p/15569483.html