先畫在爬
This commit is contained in:
parent
f7d53846a4
commit
3cc94b7e1d
@ -6,22 +6,27 @@ def createNcnuMainWin():
|
|||||||
win=Tk()
|
win=Tk()
|
||||||
win.title("暨大官網最新資訊!")
|
win.title("暨大官網最新資訊!")
|
||||||
win.geometry("600x600")
|
win.geometry("600x600")
|
||||||
main = NcnuMainAPI()
|
|
||||||
Link='''<span style="background-color:#ffcccc"><ul>'''
|
|
||||||
textLb=Label(win,text="暨大校園最新資訊",font="Helvetica 20",bg="#ffcccc")
|
textLb=Label(win,text="暨大校園最新資訊",font="Helvetica 20",bg="#ffcccc")
|
||||||
|
|
||||||
for anno in main.getAnno():
|
|
||||||
Link+='''<li> <a href={}> {}</a> </li>'''.format(anno.get("link"),anno.get("title") )
|
|
||||||
|
|
||||||
Link=Link+'''</ul></span>'''
|
|
||||||
|
|
||||||
sb=Scrollbar(win)
|
sb=Scrollbar(win)
|
||||||
htmlLable=HTMLLabel(win,html=Link)
|
htmlLable=HTMLLabel(win)
|
||||||
htmlLable.configure(yscrollcommand=sb.set)
|
htmlLable.configure(yscrollcommand=sb.set)
|
||||||
textLb.pack(fill="x")
|
textLb.pack(fill="x")
|
||||||
|
|
||||||
sb.pack(side=RIGHT,fill="y")
|
sb.pack(side=RIGHT,fill="y")
|
||||||
htmlLable.pack(fill="both",expand=True)
|
htmlLable.pack(fill="both",expand=True)
|
||||||
|
win.update()
|
||||||
|
#=====爬=====
|
||||||
|
main = NcnuMainAPI()
|
||||||
|
Link='''<span style="background-color:#ffcccc"><ul>'''
|
||||||
|
for anno in main.getAnno():
|
||||||
|
Link+='''<li> <a href={}> {}</a> </li>'''.format(anno.get("link"),anno.get("title") )
|
||||||
|
Link=Link+'''</ul></span>'''
|
||||||
|
htmlLable.set_html(Link)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
win.mainloop()
|
win.mainloop()
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user