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/ 接下来会写破解教程~
随机推荐
- $compile
<html ng-app="compile"> <head> <script src="http://apps.bdimg.com/libs ...
- 【翻译】首个基于NHibernate的应用程序
首个基于NHibernate的应用程序 Your first NHibernate based application 英文原文地址:http://www.nhforge.org/wikis/how ...
- java 简单使用redis
1.配置文件 <bean id="jedisPoolConfig" class="redis.clients.jedis.JedisPoolConfig" ...
- STL源码学习----lower_bound和upper_bound算法
转自:http://www.cnblogs.com/cobbliu/archive/2012/05/21/2512249.html 先贴一下自己的二分代码: #include <cstdio&g ...
- 网页端打开手机上的app
iOS/Android 浏览器(h5)及微信中唤起本地APP 在移动互联网,链接是比较重要的传播媒质,但很多时候我们又希望用户能够回到APP中,这就要求APP可以通过浏览器或在微信中被方便地唤起. 这 ...
- ios语音识别
p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Menlo; color: #000000; min-height: 15.0px } p.p ...
- [Android Pro] AsyncTaskLoader vs AsyncTask
reference to : http://blog.csdn.net/a910626/article/details/45599133 我看了一下asyncTask是从LV3开始,AsyncTask ...
- Post with HttpClient
HttpClient是Java中经常使用的Http Client,总结下HttpClient4中经常使用的post请求用法. 1 Basic Post 使用2个参数进行post请求: @Test pu ...
- 使用Solr索引MySQL数据
环境搭建 1.到apache下载solr,地址:http://mirrors.hust.edu.cn/apache/lucene/solr/ 2.解压到某个目录 3.cd into D:\Solr\s ...
- ACM进阶计划
ACM进阶计划ACM队不是为了一场比赛而存在的,为的是队员的整体提高.大学期间,ACM队队员必须要学好的课程有:lC/C++两种语言l高等数学l线性代数l数据结构l离散数学l数据库原理l操作系统原理l ...