AndroidKivyApp_Letters2Words.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:FunUtils 作者: HoussemCharf 项目源码 文件源码
def game(self,instance):
        letters=self.letttersinput.text
        letters = ",".join(list(letters))
        #post data
        mydata=[('letters', letters),('order','length'),('pos','beg'),('dic','1'),('table','dict')]
        #Encoding
        mydata=urllib.urlencode(mydata)
        codedPath ='''aHR0cDovL3d3dy50aGV3b3JkZmluZGVyLmNvbS9zY3JhYmJsZS5waHA='''
        path=base64.b64decode(codedPath)
        req=urllib2.Request(path, mydata)
        req.add_header("Content-type", "application/x-www-form-urlencoded")
        page=urllib2.urlopen(req).read()
        # applying beautifulsoup for parsing
        soup = BS(page,"html.parser")
        # parsing the div with id
        res = soup.find("div", { "id" : "displayresults" })
        Con= res.contents[1].contents[1]
        line=""
        for child in Con.children:
            line+= child.string
        popup = Popup(title="Result",content=Label(text=line))
        popup.open()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号