def textwindow(url):
title = url
h = html2text.HTML2Text()
h.ignore_links = True
h.ignore_images = True
s = gethtml(url)
s = h.handle(s)
s = h.unescape(s)
text = convert65536(s)
top = Tkinter.Toplevel()
top.geometry("+200+100")
top.title(title)
top.bind("<Escape>", lambda _ : top.destroy())
S = Tkinter.Scrollbar(top)
customFont = tkFont.Font(family="Arial", size=16)
T = TextPlus(top,height=20,width=78,font=customFont,bg="lightgrey")
S.pack(side=Tkinter.RIGHT,fill=Tkinter.Y)
T.pack(side=Tkinter.LEFT,fill=Tkinter.Y)
S.config(command=T.yview)
T.config(yscrollcommand=S.set)
T.insert(Tkinter.END,text)
评论列表
文章目录