PythonChallenge Level 2

http://www.pythonchallenge.com/pc/def/ocr.html

PythonChallenge Level 2_第1张图片

这个比较容易。

看下面的提示:recognize the characters. maybe they are in the book , but MAYBE they are in the page source.

直接看源码,发现有一个注释:find rare characters in the mess below

知道原来就是从一堆杂乱无章的字符中找字符,这个简单,先把那一大堆恶心的字符copy到一个文件中。比如:/tmp/PyCh。

然后:

my_file = open( '/tmp/PyCh' , 'r' ) buffer = my_file.read() my_file.close() url = '' for i in buffer: if i.isalpha(): url += i print url

结果:equality

将ocr改成equality,顺利进入下一关!


你可能感兴趣的:(PythonChallenge Level 2)