pythonchallenge 解谜 Level 6
第六关地址
http://www.pythonchallenge.com/pc/def/channel.html
和前几关一样,首先看网页源码吧。反正不看也没办法。。。
<html><!-- <-- zip --><head>
<title>now there are pairs</title>
<link rel="stylesheet" type="text/css" href="../style.css">
</head>
<body>
<center>
<img src="channel.jpg">
<br>
<!-- The following has nothing to do with the riddle itself. I just
thought it would be the right point to offer you to donate to the
Python Challenge project. Any amount will be greatly appreciated. -thesamet
--> <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="thesamet@gmail.com">
<input type="hidden" name="item_name" value="Python Challenge donations">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="tax" value="0">
<input type="hidden" name="bn" value="PP-DonationsBF">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but04.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form> </center></body></html>
有用的信息 zip。<!--内容-->翻译是。 以下与谜题本身无关。。。
所以有用的只有一个zip。一开始以为zip是一个网页,后来发现是把
http://www.pythonchallenge.com/pc/def/channel.html
变换成
http://www.pythonchallenge.com/pc/def/channel.zip
得到一个zip压缩文件。
使用python代码解压。(压缩包解压也可以)
#-*- coding:utf-8 -*-
#代码版本均为python 3.5.1
#Level 6 import zipfile
import os
import glob file = zipfile.ZipFile("channel.zip", "r") print ('''列出文件''')
for name in file.namelist():
print(name) print ('''列出文件信息''')
for info in file.infolist():
print (info.filename,"文件名")
print (info.date_time,"修改时间")
print (info.file_size,"大小")
print (info.compress_type,"压缩级别")
print (info.compress_size ,"压缩数据大小")
print (info.file_size,"未压缩文件大小") for i in range(1, 10):
print ("") print ('''解压操作 unzip''')
for name in file.namelist():
file.extract(name,os.getcwd()+"/zipfile_module") #解压到当前目录 #关闭压缩文件句柄
file.close
和之前的一关有点相似。跑了一遍代码。发现提示说答案在压缩文件注释中。
关于python压缩文件.
http://www.jb51.net/article/68417.htm
最终代码
#-*- coding:utf-8 -*-
#代码版本均为python 3.5.1
#Level 6 import zipfile
import os
import glob
import re file = zipfile.ZipFile("channel.zip", "r") p = 90052 for name in file.namelist():
line = str(file.read("%s.txt" % p))
m = re.search('Next nothing is ([0-9]+)', line)
print (file.getinfo("%s.txt" % p).comment.decode("utf-8"), end=" ")
p = m.group(1)
下一关地址。
http://www.pythonchallenge.com/pc/def/oxygen.html
pythonchallenge 解谜 Level 6的更多相关文章
- pythonchallenge 解谜 Level 0
解谜地址: http://www.pythonchallenge.com/pc/def/0.html 这题没什么难度,意思就是得到2的38次方的值,然后,替换 http://www.pythoncha ...
- pythonchallenge 解谜 Level 8
#-*- coding:utf-8 -*- #代码版本均为python 3.5.1 #Level 7 import bz2 un=b'BZh91AY&SYA\xaf\x82\r\x00\x00 ...
- pythonchallenge 解谜 Level 7
#-*- coding:utf-8 -*- #代码版本均为python 3.5.1 #Level 7 from PIL import Image x_begin, x_end = 0, 609 y_b ...
- pythonchallenge 解谜 Level 5
第五关的确很坑爹... 不过,根据之前的思路,我想着是把信息放在了 “源码” 中. 翻了下源码.有用的东西在以下部分. <html><head> <title>pe ...
- pythonchallenge 解谜 Level 4
下一关... 一张图片,于是就点击了一下. 跳转到了 http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing=12345 显示的是: ...
- pythonchallenge 解谜 Level 3
第三关. 问题的解法在于正则表达式. 首先...你应该能找到需要正则的字符在哪里...那就好了! 题意就是说: One small letter, surrounded by EXACTLY thre ...
- pythonchallenge 解谜 Level 2
好吧,赶紧贴一下. #-*- coding:utf-8 -*- #代码版本均为python 3.5.1 #Level 2 import re file = open("Level 2.txt ...
- pythonchallenge 解谜 Level 1
得到第一关地址后可以进行第一关的解析了. 看起来好神秘的样子.但是也就是把字母 k 变成 m , o 变成 q ,e 变成 g.将字母对应的ASCII的值+2就行了. #-*- coding:utf- ...
- pythonchallenge 解谜
所有代码均使用python 3.5.1 版本 最近在学python,闲来无事觉得这个解谜还挺有意思. 解谜网址 http://www.pythonchallenge.com/ 接下来会写破解教程~
随机推荐
- 安装yum
RedHat 安装配置 YUM 删除 1 . 查询系统是否安装 yum : rpm – qa|grep yum 2删除原有 yum rpm -qa|grep yum|xargs rpm -e – no ...
- iOS10 推送必看(基础篇)
虽然这篇文章比较长,也不好理解,但是还是建议大家收藏,以后用到的时候,可以看看,有耐心的还是读一读. 这篇文章开始,我会跟大家好好讲讲,苹果新发布的iOS10的所有通知类. 一.创建本地通知事例详解: ...
- width:100%;与width:auto;的区别
<div> <p>1111</p> </div> div{ width:980px; background-color: #ccc; height:30 ...
- 用typedef定义函数指针的问题
在学习windows API的时候,遇到下面这段代码 以前见过的typedef的用法都是给一个数据类型取一个别名 typedef oldTypeName newTypeName 这种给数据类型 ...
- PHP单例模式
//1.单例模式//目的:为了控制对象的数量(只能够有一个,相当于类的计划生育)//做法//1.将类的构造函数做成私有的//2.在类里面做了一个公有的函数来造对象//3.将该函数变为静态的//4.在函 ...
- [WPF]WPF Data Virtualization和UI Virtualization
这篇博客将介绍WPF中的虚拟化技术. 1. Data Virtualization 通常情况下我们说数据虚拟化是指数据源没有完全加载,仅加载当前需要显示的数据呈现给用户.这种场景会让我们想到数据分页显 ...
- ng1.3+表单验证<AngularJs>
前一篇文章说过,ng1.3+以后对于表单验证有了优化,它不再需要一个详细的表达式状态创建元素显示或隐藏. 例如:我们在ng1.3之前的版本都需要如下写法: <div class="er ...
- Tor网络突破IP封锁,爬虫好搭档【入门手册】
本文地址:http://www.cnblogs.com/likeli/p/5719230.html 前言 本文不提供任何搭梯子之类的内容,我在这里仅仅讨论网络爬虫遇到的IP封杀,然后使用Tor如何对抗 ...
- 【Mybatis架构】Mapper映射文件中的#{}与${}
前言 还记得当初从北京回来的时候,跟着倪文杰师姐做JavaITOO的一卡通模块,我亲姐贾梦洁带着我一块做,期间,我遇到了一个特别奇葩的问题,就死我要实现Mybatis的模糊查询,根据当时亲姐教给我方法 ...
- jQuery的DOM操作详解
DOM(Document Object Model-文档对象模型):一种与浏览器, 平台, 语言无关的规则, 使用该接口可以轻松地访问页面中所有的标准组件DOM操作的分类 核心-DOM: DOM Co ...