PythonChallenge之level-6解题报告
来源:互联网 发布:java log输出 到网页 编辑:程序博客网 时间:2024/06/02 02:59
PythonChallenge之level-6解题报告
前面有几个还没写 下次有时间了补上
level-6:
题目地址:
http://www.pythonchallenge.com/pc/def/channel.html
啥都没有?
在这种情况下 咱们一般都是去看源代码
有个zip提示 ,那么咱们把html改成http://www.pythonchallenge.com/pc/def/channel.zip
可以下载,下载下来发现是一个zip包
看到一个readme.txt
提示如下:
看了下txt,发现跟前面的一关很像,于是这样写代码:
nothing='90052'while 1: if not nothing: break else: file=open('./channel/%s.txt' % nothing,'r') s=file.read() print(s) index=s.index('is')+3 nothing=s[index:] print(nothing)
发现 程序在46145处停止了
打开这个文件 看到:
到这个就不知道咋办
幸好 我有一个大神舍友 在他的提示下,去百度了下 zipfile这个模块
没错 ,这关需要用到zipfile!!!
具体怎么用自己去百度吧 我上代码:
nothing='90052.txt'z=zipfile.ZipFile('channel.zip')while 1: content=z.read(nothing) sys.stdout.write(z.getinfo(nothing).comment) if 'comments' in content: break index=content.index('is')+3 nothing=content[index:]+'.txt'
程序运行结果:
到这里 好激动 赶紧提交
没想到出来一句话 说什么在空气中,什么鬼…………
苦思冥想,找不到答案,回头去看HOCKEY
哟 让我发现了答案 原来就是组成HOCKEY 的那些字母啊
oxygen(氧气)
终于,答案正确
通关地址:
http://www.pythonchallenge.com/pc/def/oxygen.html
接下来进入下一关
0 0
- PythonChallenge之level-6解题报告
- PythonChallenge之level-0解题报告
- PythonChallenge之level-1解题报告
- PythonChallenge之level-2解题报告
- PythonChallenge 挑战之路 Level-6
- PythonChallenge Level 6
- Python挑战游戏( PythonChallenge)闯关之路Level- 6
- python3.3.1 pythonchallenge 通关之level 1
- python3.3.1 pythonchallenge 通关之level 2
- python3.3.1 pythonchallenge 通关之level 3
- python3.3.1 pythonchallenge 通关之level 4
- PythonChallenge 挑战之路 Level-0
- PythonChallenge 挑战之路 Level-1
- PythonChallenge 挑战之路 Level-2
- PythonChallenge 挑战之路 Level-3
- PythonChallenge 挑战之路 Level-4
- PythonChallenge 挑战之路 Level-5
- PythonChallenge 挑战之路 Level-7
- 如何去掉ECSHOP meta标签中的版本号
- Ubuntu 安装mysql和简单操作
- OpenGL实现鼠标绕任意轴旋转/平移/缩放
- 做一个合格的程序猿之MYSQLSQL的EXPLAIN使用(四)
- 6 Methods For Vertical Centering With CSS
- PythonChallenge之level-6解题报告
- //快排思想第k大
- 【TSQL】排序的简单应用
- 蓝牙 Core Bluetooth
- erlang趣事五之catch和try_catch
- 高斯混合模型(GMM)实现和可视化
- Java 类加载器
- 插入排序
- 239.255.255.250:1900