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/ 接下来会写破解教程~
随机推荐
- mysqlDBA(1-3年)
1.熟悉Aliyun操作系统的管理.配置和系统调优: 2.熟悉mysql管理 3.熟悉mysql主从复制,主主复制 4.熟悉数据库的备份策略,监控策略,性能测量策略 5.熟悉linux/unix操作系 ...
- webpack常用配置总结
1. webpack简介 webpack 是一个模块打包工具.它使得模块相互依赖并且可构建等价于这些模块的静态资源.相比于已经存在的模块打包器(module bundler),webpack的开发动机 ...
- C语言 关于内存动态分配问题
全局变量:分配到 内存的静态区. 局部变量(非静态):分配到 内存的动态区.在存储区中称为栈(stack) 临时数据(C允许内存动态分配区域):存放在自由空间区,称为堆区(heap) 内存动态分配 得 ...
- html内的空格占位
写html的时候有时因为字数不够会根据字段长度添加多个空格,但是在html中添加空格是没有用的,所以使用空格的代替符号有: 不断行的空白(1个字符宽度) 半个空白(1个字符宽度) 一个空白 ...
- Docker Container 配置独立IP
1.宿主机安装网桥工具包 要是Linux可以工作在网桥模式,必须安装网桥工具bridge-utils,运行命令: yum install bridge-utils
- Oracle Database 12c Release 1下载安装(自身经历)
1.访问Oracle官网:https://www.oracle.com/index.html,下载Oracle Database 12c Release 1 (注意:File1和File2都要下载!! ...
- SecureCRT如何与Linux虚拟机进行关联
首先在宿主机上确认虚拟网卡是否正确工作,并查看其IP地址,如本例中,宿主机的虚拟网卡VMnet8的IP地址为:192.168.121.1/24. VMnet8是VMware用于NAT连接的虚拟网卡. ...
- LeetCode 368
题目描述: Given a set of distinct positive integers, find the largest subset such that every pair (Si, S ...
- Linux 2.6内核中新的锁机制--RCU
转自:http://www.ibm.com/developerworks/cn/linux/l-rcu/ 一. 引言 众所周知,为了保护共享数据,需要一些同步机制,如自旋锁(spinlock),读写锁 ...
- 2016 Google中国开发者大会游记
本文地址:http://www.cnblogs.com/likeli/p/6146117.html 写在前面 平时一直埋头写代码,这次既然Google给了门票,也就来看看,看看这种世界顶尖的科技公司, ...