pythonchallenge 解谜 Level 5
2016-05-20 15:15
519 查看
第五关的确很坑爹。。。
不过,根据之前的思路,我想着是把信息放在了 “源码” 中。
翻了下源码。有用的东西在以下部分。
出现了一个 src = "banner.p" 应该是一个有用的文件,替换下 url 下载,打开后发现
下一个信息 peak hell sounds familiar ? pick? 于是手动百度过发现有 pickle 这个模块。
替换下 url 发现下一个页面是 yes! pickle! 说明我们的方向是对的。
关于 pickle 模板 的使用。下面豆瓣这个介绍还是值得看一下的。
想着我们得到的文件应该是需要把文件进行重构对象。
重构先。
得到的是
接下来把这些输出进行处理。代码如下
然后,进入下一关。
不过,根据之前的思路,我想着是把信息放在了 “源码” 中。
翻了下源码。有用的东西在以下部分。
<html><head> <title>peak hell</title> <link rel="stylesheet" type="text/css" href="../style.css"> <script async="" src="http://c.cnzz.com/core.php"></script></head> <body> <center> <img src="peakhell.jpg"> <br><font color="#c0c0ff"> pronounce it <br> <peakhell src="banner.p"> <!-- peak hell sounds familiar ? --> </peakhell></font></center></body></html>
出现了一个 src = "banner.p" 应该是一个有用的文件,替换下 url 下载,打开后发现
(lp0 (lp1 (S' ' p2 I95 tp3 aa(lp4 ...
下一个信息 peak hell sounds familiar ? pick? 于是手动百度过发现有 pickle 这个模块。
替换下 url 发现下一个页面是 yes! pickle! 说明我们的方向是对的。
关于 pickle 模板 的使用。下面豆瓣这个介绍还是值得看一下的。
https://www.douban.com/note/143585267/
想着我们得到的文件应该是需要把文件进行重构对象。
重构先。
#-*- coding:utf-8 -*- #代码版本均为python 3.5.1 #Level 5 import pickle pkl_file = open('banner.p', 'rb') data = pickle.load(pkl_file) print (data)
得到的是
[[(' ', 95)], [(' ', 14), ('#', 5), (' ', 70), ('#', 5), (' ', 1)], [(' ', 15), ('#', 4), (' ', 71), ('#', 4), (' ', 1)], [(' ', 15), ('#', 4), (' ', 71), ('#', 4), (' ', 1)], [(' ', 15), ('#', 4), (' ', 71), ('#', 4), (' ', 1)], [(' ', 15), ('#', 4), (' ', 71), ('#', 4), (' ', 1)], [(' ', 15), ('#', 4), (' ', 71), ('#', 4), (' ', 1)], [(' ', 15), ('#', 4), (' ', 71), ('#', 4), (' ', 1)], [(' ', 15), ('#', 4), (' ', 71), ('#', 4), (' ', 1)], [(' ', 6), ('#', 3), (' ', 6), ('#', 4), (' ', 3), ('#', 3), (' ', 9), ('#', 3), (' ', 7), ('#', 5), (' ', 3), ('#', 3), (' ', 4), ('#', 5), (' ', 3), ('#', 3), (' ', 10), ('#', 3), (' ', 7), ('#', 4), (' ', 1)], [(' ', 3), ('#', 3), (' ', 3), ('#', 2), (' ', 4), ('#', 4), (' ', 1), ('#', 7), (' ', 5), ('#', 2), (' ', 2), ('#', 3), (' ', 6), ('#', 4), (' ', 1), ('#', 7), (' ', 3), ('#', 4), ...
接下来把这些输出进行处理。代码如下
#-*- coding:utf-8 -*- #代码版本均为python 3.5.1 #Level 5 import pickle pkl_file = open('banner.p', 'rb') data = pickle.load(pkl_file) print (data)
print ('\n'.join([''.join([p[0] * p[1] for p in row]) for row in data]))
然后,进入下一关。
##### ##### #### #### #### #### #### #### #### #### #### #### #### #### #### #### ### #### ### ### ##### ### ##### ### ### #### ### ## #### ####### ## ### #### ####### #### ####### ### ### #### ### ### ##### #### ### #### ##### #### ##### #### ### ### #### ### #### #### ### ### #### #### #### #### ### #### #### ### #### #### ### #### #### #### #### ### ### #### #### #### #### ## ### #### #### #### #### #### ### #### #### #### #### ########## #### #### #### #### ############## #### #### #### #### ### #### #### #### #### #### #### #### #### #### #### #### ### #### #### #### #### #### #### ### #### #### #### ### #### #### #### #### ### #### ### ## #### #### ### #### #### #### #### #### ### ## #### ### ## #### #### ########### #### #### #### #### ### ## #### ### ###### ##### ## #### ###### ########### ##### ### ######
http://www.pythonchallenge.com/pc/def/channel.html
相关文章推荐
- python 正则过滤四字节字符
- Python import语句导入模块语法
- python+ARIMA 进行时间序列处理
- 用户三次登陆锁定
- Python学习笔记
- python 列表、元组操作
- python 解析web接口的json数据
- Python初级课程——1_Python简介及特色
- python的list和tuple
- python 整体输出字典中的中文
- python中高级特性
- python3设置默认编码为utf-8
- Python开发入门到实践
- python链接mysql数据库并以键值对的形式查询显示
- python安装与windows开发环境搭建
- python爬虫--连接数据库
- 线性回归学习数字加法
- 任意大数字加法的python实现
- python线程池(threadpool)模块使用
- python3.4-import方法返回“identifier expected”