zoukankan      html  css  js  c++  java
  • 使用python 3.x 对pythonchallenge-----6的解答过程

    pythonchallenge-6地址 : http://www.pythonchallenge.com/pc/def/channel.html
    图片如下:


    题目解析:源码提示“zip”,随即尝试将网页地址中的“html”换成“zip”,提示下载压缩包
    在压缩包中,读取readme.txt 后明白,和nothing一样,要一个一个读取压缩包里面的文件。
    解题过程:

    import zipfile
    
    filename = r"./other/channel.zip"
    
    z = zipfile.ZipFile(filename,'r')
    
    nothing = '90052'
    li = []
    
    def getnothing(nothing):
        i = 0
        if i < len(z.namelist()):
            filename = nothing+'.txt'
            if filename in z.namelist():
                text = z.read(z.getinfo(filename)).decode()
                nothing = str.split(text,' ')[-1]
                i = i + 1
                li.append(z.getinfo(filename).comment.decode())
                getnothing(nothing)
        else:
            print("The end!")
    
    getnothing(nothing)
    
    print(''.join(li))
    

     答案:答案不是HOCKEY   答案是oxygen

    ****************************************************************
    ****************************************************************
    **                                                            **
    **   OO    OO    XX      YYYY    GG    GG  EEEEEE NN      NN  **
    **   OO    OO  XXXXXX   YYYYYY   GG   GG   EEEEEE  NN    NN   **
    **   OO    OO XXX  XXX YYY   YY  GG GG     EE       NN  NN    **
    **   OOOOOOOO XX    XX YY        GGG       EEEEE     NNNN     **
    **   OOOOOOOO XX    XX YY        GGG       EEEEE      NN      **
    **   OO    OO XXX  XXX YYY   YY  GG GG     EE         NN      **
    **   OO    OO  XXXXXX   YYYYYY   GG   GG   EEEEEE     NN      **
    **   OO    OO    XX      YYYY    GG    GG  EEEEEE     NN      **
    **                                                            **
    ****************************************************************
     **************************************************************
    
     
     
  • 相关阅读:
    MTK android flash配置
    MTK平台缩写
    百度员工离职总结:如何做个好员工
    android 分区layout以及虚拟内存布局-小结
    Android eMMC Booting
    Android gingerbread eMMC booting
    Chrome插件开发
    jsonp解决CORS问题
    【好玩】将js代码转为日式表情
    多行文本溢出显示省略号(...)的方法
  • 原文地址:https://www.cnblogs.com/yinsjun/p/7473643.html
Copyright © 2011-2022 走看看