Pythonchallenge Level 7 (python2.7)

本文通过Python编程展示了如何从特定的图片中提取隐藏的文本信息。利用灰度转换及正则表达式等技术手段,成功解析出了图片内隐藏的一系列字符,并最终揭示了答案为'integrity'。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

In my opinion, this challenge needs more patience and observation!

>>> import Image
>>> image=Image.open('/homeDownloads/oxygen.png')
>>> data=image.convert('L').getdata()
>>> str=''
>>> s_data=[]
>>> for i in range(19918,39836): # 2/3 of the image
s_data.append(data[i])

>>> for t in s_data:
str=str+chr(t)

[img]http://dl2.iteye.com/upload/attachment/0085/4689/6a2e5cab-1ccb-39ee-8edd-fa78bfd488ae.jpg[/img]

#find something unusual
#pick these stuff out
>>> import re
>>> s_str=re.search('s{5}.+/b',str)
>>> str=s_str.group()
>>> c='s'
>>> for ch in range(5,len(str),7):
c=c+str[ch]

>>> hint=[105, 110, 116, 101, 103, 114, 105, 116, 121]
>>> m=''
>>> for ch in hint:
m=m+chr(ch)

the final answer is ''integrity''
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值