def __init__(self, root, controller): sw = tix.ScrolledWindow(self, scrollbar=tix.Y) sw.pack(fill=tix.BOTH, expand=1) colList = [ 'Recipe Name:', 'Recipe Summary:', "Today's Date:", 'Type of cuisine:', 'Ingredients (format - ingredient,amount,unit then enter):', 'Recipe Text:', 'Prep Time:', 'Cook Time:', 'Calories:', 'Servings:', 'Tags:' ] label = [0] * len(colList) text = [0] * len(colList) for i in range(0, len(colList)): label[i] = ttk.Label(self, text=colList[i], font=LARGE_FONT) label[i].pack(padx=15, pady=2, anchor='nw') if (i in [0, 2, 3, 6, 7, 8, 9, 10]): text[i] = tk.Entry(self, borderwidth=2) text[i].pack(ipadx=720 - 30, padx=15, pady=(5, 20), anchor='nw') else: text[i] = tkst.ScrolledText(self, height=7, borderwidth=2) text[i].pack(ipadx=720 - 30, padx=15, pady=(5, 20), anchor='nw')
def initialize(self): global app global sw app = tk.Tk() self.adjust_window_position(850, 500, app) sw = tk.ScrolledWindow(app, scrollbar=tk.Y) sw.pack(fill=tk.BOTH, expand=1) self.parse_logs()
def __init__(self): self.root = tk.Tk() self.root.geometry('700x700') self.scrollbar = tk.ScrolledWindow(self.root, scrollbar=tk.BOTH) self.scrollbar.pack(fill=tk.BOTH, expand=1) self.top_frame = tk.Frame(self.scrollbar.window) self.top_frame.pack(side=tk.TOP) self.bottom_frame = tk.Frame(self.scrollbar.window) self.bottom_frame.pack(side=tk.BOTTOM) self.forward = tk.Button(self.bottom_frame, text='далее') self.forward.pack(side=tk.LEFT) self.forward.bind('<1>', self.click_forward) self.forward.pos = '' self.path = tk.Label(self.bottom_frame, text='') self.path.pack(side=tk.LEFT)
def append_window(self): global show_Data import Tix as tk root_1 = tk.Tk() root_1.geometry("800x50") swn = tk.ScrolledWindow(root_1, scrollbar=tk.Y) swn.pack(fill=tk.BOTH, expand=1) def show_Data(classname_, identifier, textva, pos): frame1 = Frame(swn.window, width=100, borderwidth=2, relief="groove") frame1.pack(side="top", fill="x") label = Label(frame1, width=20, text=classname_) label.grid(row=0, column=0, padx=5) label1 = Label(frame1, width=20, text=identifier) label1.grid(row=0, column=1, padx=5) label2 = Label(frame1, width=20, text=textva) label2.grid(row=0, column=2, padx=5) label3 = Label(frame1, width=20, text=pos) label3.grid(row=0, column=3, padx=5) b1 = Button(swn, text="OK") b1.pack(side="left") b2 = Button(swn, text="Add Field", command=self.add_Element) b2.pack(side="right") root_1.mainloop()
'gray10', 'gray11', 'gray12', 'gray13', 'gray14', 'gray15', 'gray16', 'gray17', 'gray18', 'gray19', 'gray20', 'gray21', 'gray22', 'gray23', 'gray24', 'gray25', 'gray26', 'gray27', 'gray28', 'gray29', 'gray30', 'gray31', 'gray32', 'gray33', 'gray34', 'gray35', 'gray36', 'gray37', 'gray38', 'gray39', 'gray40', 'gray42', 'gray43', 'gray44', 'gray45', 'gray46', 'gray47', 'gray48', 'gray49', 'gray50', 'gray51', 'gray52', 'gray53', 'gray54', 'gray55', 'gray56', 'gray57', 'gray58', 'gray59', 'gray60', 'gray61', 'gray62', 'gray63', 'gray64', 'gray65', 'gray66', 'gray67', 'gray68', 'gray69', 'gray70', 'gray71', 'gray72', 'gray73', 'gray74', 'gray75', 'gray76', 'gray77', 'gray78', 'gray79', 'gray80', 'gray81', 'gray82', 'gray83', 'gray84', 'gray85', 'gray86', 'gray87', 'gray88', 'gray89', 'gray90', 'gray91', 'gray92', 'gray93', 'gray94', 'gray95', 'gray97', 'gray98', 'gray99' ] def drawframes(_sw): for c in COLORS: e = tk.Label(sw.window, text=c, background=c) e.pack(fill=tk.X) r = tk.Tk() r.title("Named colour chart") sw = tk.ScrolledWindow(r, scrollbar=tk.BOTH) sw.pack(fill=tk.BOTH, expand=1) drawframes(sw) r.mainloop()
def __init__(self,visualize,visualizescore,visualizeindex): self.window=tix.Tk() self.window.title("Results Page") scr_win = tix.ScrolledWindow(self.window,width=1500, height=786) scr_win.grid(row=0,column=0) sframe = scr_win.window n=len(visualize) p=int(n/5) pp=n%5 print("total pages : "+str(p+1),"last page entries : "+str(pp)) # sorting visualize courseobjects=[] percentagematch1=[] stringmatches=[] for i in visualizescore : percentagematch1.append(i) visualizescore.sort(reverse=True) i=0 percentagematch=[] while i<len(visualizeindex) : p=percentagematch1.index(visualizescore[i]) courseobjects.append(visualizeindex[p]) stringmatches.append(visualize[p]) percentagematch.append(visualizescore[i]) i=i+1 # print(courseobjects) # print(stringmatches) # print(percentagematch) # i=0 # # while i<len(courseobjects) : # # print(courseobjects[i]) # # print(stringmatches[i]) # # print(percentagematch[i]) # # print("\n\n") # # i=i+1 def visualizebutton(mm): # print("________________match words ________") # print(mm.matchwords) # print("__________________source topics________________") # print(mm.sourcetopics) # print("__________________target topics________________") # print(mm.topics) # print("__________________topic matching_______________________") i=0 while i <len(mm.matchwords): print(mm.matchwords[i]+" : "+mm.matchwords[i+1]+" : "+str(mm.matchvalues[i])) i=i+2 print("-------------") print(mm.matchwords) c=comparepage(mm) def visitbutton(mm): print(mm.url) webbrowser.open(mm.url) i=0 coursefuncobjects=[] while i<len(courseobjects): m=courseobjects[i] mm=course(m) mm.percentage=percentagematch[i] mm.string=stringmatches[i] zx=[] zxv=[] zxc=[] k=stringmatches[i] for kk in k : kkk=kk.split(" :") v=kkk[1] j=kkk[0] jj=j.split("==") zxc.append(jj[0]) if int(v)>0 : j=kkk[0] jj=j.split("==") zx.append(jj[0]) zx.append(jj[1]) zxv.append(int(v)) zxv.append(int(v)) mm.matchwords=zx mm.matchvalues=zxv mm.sourcetopics=zxc coursefuncobjects.append(mm) i=i+1 # print(str(mm.title)+"\n"+"percentage matched :"+str(mm.percentage)+"\n"+str(mm.creators)+"\n"+str(mm.level)+" "+str(mm.startdate)+"; "+str(mm.duration)+"\n"+str(mm.review)+"pricing : "+"N/A") # m=visualizeindex[0] # mm=m.find("coursetitle").text # lbl1 = tkinter.Label(self.window, text="Title : "+str(mm),font=("Arial Black",35)) # lbl1.pack() # info=str(mm.title)+"\n"+str(mm.url)+"\n"+"percentage matched :"+str(mm.percentage)+"\n"+"Created By :"+str(mm.creators)+"\n"+"level :"+str(mm.level)+" ; "+str(mm.startdate)+"; "+str(mm.duration)+"\n"+str(mm.review)+"pricing : "+"N/A" # print("\n\n\n\n") # print(mm.topics) # print(mm.string) # print(mm.matchwords) # print(mm.matchvalues) # print("\n\n\n\n") # mm0=courseobjects[0] # info0=str(mm.title)+"\n"+str(mm.url)+"\n"+"percentage matched :"+str(mm.percentage)+"\n"+"Created By :"+str(mm.creators)+"\n"+"level :"+str(mm.level)+" ; "+str(mm.startdate)+"; "+str(mm.duration)+"\n"+str(mm.review)+"pricing : "+"N/A" # lbl0 = tix.Label(sframe, text=info,font=("Arial Black",20)) # lbl1.grid(row=2*i,column=0) # nextbutton=tix.Button(sframe,text="Visit",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visitbutton(mm)) # nextbutton.grid(row=2*i,column=1) # nextbutton=tix.Button(sframe,text="Compare",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visualizebutton(mm)) # nextbutton.grid(row=2*i,column=2) # lbl1 = tix.Label(sframe, text="______________________________________________________________",font=("Arial Black",20)) # lbl1.grid(row=2*i+1,column=0) def roundstring22(str): l=len(str) i=18-l str=str+" " return str def roundstring85(str): l=len(str) # print(l) i=20-l str=" "+str return str def infofunc(mm): info="" title=mm.title title=roundstring85(title) l="Course Name" l=roundstring22(l) info=info+l+":"+title+"\n" provider="Coursera" provider=roundstring85(provider) l="MOOC Provider" l=roundstring22(l) info = info+l+":"+provider+"\n" link=mm.url link=roundstring85(link) l="Course Link" l=roundstring22(l) info=info+l+" : "+link+"\n" offeredby=mm.creators offeredby=roundstring85(offeredby) l="Offered By" l=roundstring22(l) info=info+l+":"+offeredby+"\n" z=mm.startdate x="no start date " # print(z,k) if z==x : zx="Self Paced" zx=roundstring85(zx) zxs="Course Type" zxs=roundstring22(zxs) duration=mm.duration duration=roundstring85(duration) d="Estimated Duration" d=roundstring22(d) info = info+zxs+":"+zx+"\n"+d+":"+duration+"\n" z1="Avg User Rating" z=roundstring22(z1) x=mm.review x=roundstring85(x) info=info+z+":"+x+"\n" p="Percentage Match" p=roundstring22(p) pp=mm.percentage pp=str(round(pp, 2)) pp=roundstring85(pp) info=info+p+":"+pp+"\n" p="Price" p=roundstring22(p) pp="Not Available" pp=roundstring85(pp) info=info+p+":"+pp return info else : zx="Scheduled" zx=roundstring85(zx) zxs="Course Type" zxs=roundstring22(zxs) startdate=mm.startdate startdate=roundstring85(startdate) d="Start Date" d=roundstring22(d) info = info+zxs+":"+zx+"\n"+d+":"+startdate+"\n" z="Avg User Rating" z=roundstring22(z) x=mm.review x=roundstring85(x) info=info+z+":"+x+"\n" p="Percentage Match" p=roundstring22(p) pp=mm.percentage pp=str(round(pp, 2)) pp=roundstring85(pp) info=info+p+":"+pp+"\n" p="Price" p=roundstring22(p) pp="Not Available" pp=roundstring85(pp) info=info+p+":"+pp return info i=0 try: # print("0") mm0=coursefuncobjects[i] # print("1") info=infofunc(mm0) # print("2") lbl0 = tix.Label(sframe, text=info,font=("Arial Black",20)) lbl0.grid(row=2*i,column=0) nextbutton0=tix.Button(sframe,text="Visit",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visitbutton(mm0)) nextbutton0.grid(row=2*i,column=1) nextbutton00=tix.Button(sframe,text="Compare",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visualizebutton(mm0)) nextbutton00.grid(row=2*i,column=2) lbl0 = tix.Label(sframe, text="______________________________________________________________",font=("Arial Black",20)) lbl0.grid(row=2*i+1,column=0) except : pass i=1 try: mm1=coursefuncobjects[i] info=infofunc(mm1) lbl = tix.Label(sframe, text=info,font=("Arial Black",20)) lbl.grid(row=2*i,column=0) nextbutton1=tix.Button(sframe,text="Visit",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visitbutton(mm1)) nextbutton1.grid(row=2*i,column=1) nextbutton11=tix.Button(sframe,text="Compare",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visualizebutton(mm1)) nextbutton11.grid(row=2*i,column=2) lbl = tix.Label(sframe, text="______________________________________________________________",font=("Arial Black",20)) lbl.grid(row=2*i+1,column=0) except : pass i=2 try: mm2=coursefuncobjects[i] info=infofunc(mm2) lbl1 = tix.Label(sframe, text=info,font=("Arial Black",20)) lbl1.grid(row=2*i,column=0) nextbutton2=tix.Button(sframe,text="Visit",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visitbutton(mm2)) nextbutton2.grid(row=2*i,column=1) nextbutton22=tix.Button(sframe,text="Compare",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visualizebutton(mm2)) nextbutton22.grid(row=2*i,column=2) lbl1 = tix.Label(sframe, text="______________________________________________________________",font=("Arial Black",20)) lbl1.grid(row=2*i+1,column=0) except : pass i=3 try: mm3=coursefuncobjects[i] info=infofunc(mm3) lbl1 = tix.Label(sframe, text=info,font=("Arial Black",20)) lbl1.grid(row=2*i,column=0) nextbutton3=tix.Button(sframe,text="Visit",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visitbutton(mm3)) nextbutton3.grid(row=2*i,column=1) nextbutton33=tix.Button(sframe,text="Compare",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visualizebutton(mm3)) nextbutton33.grid(row=2*i,column=2) lbl1 = tix.Label(sframe, text="______________________________________________________________",font=("Arial Black",20)) lbl1.grid(row=2*i+1,column=0) except : pass i=4 try: mm4=coursefuncobjects[i] info=infofunc(mm4) lbl1 = tix.Label(sframe, text=info,font=("Arial Black",20)) lbl1.grid(row=2*i,column=0) nextbutton4=tix.Button(sframe,text="Visit",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visitbutton(mm4)) nextbutton4.grid(row=2*i,column=1) nextbutton44=tix.Button(sframe,text="Compare",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visualizebutton(mm4)) nextbutton44.grid(row=2*i,column=2) lbl1 = tix.Label(sframe, text="______________________________________________________________",font=("Arial Black",20)) lbl1.grid(row=2*i+1,column=0) except : pass i=5 try: mm5=coursefuncobjects[i] info=infofunc(mm5) lbl1 = tix.Label(sframe, text=info,font=("Arial Black",20)) lbl1.grid(row=2*i,column=0) nextbutton5=tix.Button(sframe,text="Visit",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visitbutton(mm5)) nextbutton5.grid(row=2*i,column=1) nextbutton55=tix.Button(sframe,text="Compare",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visualizebutton(mm5)) nextbutton55.grid(row=2*i,column=2) lbl1 = tix.Label(sframe, text="______________________________________________________________",font=("Arial Black",20)) lbl1.grid(row=2*i+1,column=0) except : pass i=6 try: mm6=coursefuncobjects[i] info=infofunc(mm6) lbl1 = tix.Label(sframe, text=info,font=("Arial Black",20)) lbl1.grid(row=2*i,column=0) nextbutton6=tix.Button(sframe,text="Visit",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visitbutton(mm6)) nextbutton6.grid(row=2*i,column=1) nextbutton66=tix.Button(sframe,text="Compare",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visualizebutton(mm6)) nextbutton66.grid(row=2*i,column=2) lbl1 = tix.Label(sframe, text="______________________________________________________________",font=("Arial Black",20)) lbl1.grid(row=2*i+1,column=0) except : pass i=7 try: mm7=coursefuncobjects[i] info=infofunc(mm7) lbl1 = tix.Label(sframe, text=info,font=("Arial Black",20)) lbl1.grid(row=2*i,column=0) nextbutton7=tix.Button(sframe,text="Visit",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visitbutton(mm7)) nextbutton7.grid(row=2*i,column=1) nextbutton77=tix.Button(sframe,text="Compare",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visualizebutton(mm7)) nextbutton77.grid(row=2*i,column=2) lbl1 = tix.Label(sframe, text="______________________________________________________________",font=("Arial Black",20)) lbl1.grid(row=2*i+1,column=0) except : pass i=8 try: mm8=coursefuncobjects[i] info=infofunc(mm8) lbl1 = tix.Label(sframe, text=info,font=("Arial Black",20)) lbl1.grid(row=2*i,column=0) nextbutton8=tix.Button(sframe,text="Visit",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visitbutton(mm8)) nextbutton8.grid(row=2*i,column=1) nextbutton88=tix.Button(sframe,text="Compare",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visualizebutton(mm8)) nextbutton88.grid(row=2*i,column=2) lbl1 = tix.Label(sframe, text="______________________________________________________________",font=("Arial Black",20)) lbl1.grid(row=2*i+1,column=0) except : pass i=9 try: mm9=coursefuncobjects[i] info=infofunc(mm9) lbl1 = tix.Label(sframe, text=info,font=("Arial Black",20)) lbl1.grid(row=2*i,column=0) nextbutton9=tix.Button(sframe,text="Visit",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visitbutton(mm9)) nextbutton9.grid(row=2*i,column=1) nextbutton99=tix.Button(sframe,text="Compare",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visualizebutton(mm9)) nextbutton99.grid(row=2*i,column=2) lbl1 = tix.Label(sframe, text="______________________________________________________________",font=("Arial Black",20)) lbl1.grid(row=2*i+1,column=0) except : pass i=10 try: mm10=coursefuncobjects[i] info=infofunc(mm10) lbl0 = tix.Label(sframe, text=info,font=("Arial Black",20)) lbl0.grid(row=2*i,column=0) nextbutton10=tix.Button(sframe,text="Visit",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visitbutton(mm10)) nextbutton10.grid(row=2*i,column=1) nextbutton1010=tix.Button(sframe,text="Compare",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visualizebutton(mm10)) nextbutton1010.grid(row=2*i,column=2) lbl0 = tix.Label(sframe, text="______________________________________________________________",font=("Arial Black",20)) lbl0.grid(row=2*i+1,column=0) except : pass i=11 try: mm11=coursefuncobjects[i] info=infofunc(mm11) lbl = tix.Label(sframe, text=info,font=("Arial Black",20)) lbl.grid(row=2*i,column=0) nextbutton11=tix.Button(sframe,text="Visit",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visitbutton(mm11)) nextbutton11.grid(row=2*i,column=1) nextbutton1111=tix.Button(sframe,text="Compare",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visualizebutton(mm11)) nextbutton1111.grid(row=2*i,column=2) lbl = tix.Label(sframe, text="______________________________________________________________",font=("Arial Black",20)) lbl.grid(row=2*i+1,column=0) except : pass i=12 try: mm12=coursefuncobjects[i] info=infofunc(mm12) lbl1 = tix.Label(sframe, text=info,font=("Arial Black",20)) lbl1.grid(row=2*i,column=0) nextbutton12=tix.Button(sframe,text="Visit",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visitbutton(mm12)) nextbutton12.grid(row=2*i,column=1) nextbutton1212=tix.Button(sframe,text="Compare",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visualizebutton(mm12)) nextbutton1212.grid(row=2*i,column=2) lbl1 = tix.Label(sframe, text="______________________________________________________________",font=("Arial Black",20)) lbl1.grid(row=2*i+1,column=0) except : pass i=13 try: mm13=coursefuncobjects[i] info=infofunc(mm13) lbl1 = tix.Label(sframe, text=info,font=("Arial Black",20)) lbl1.grid(row=2*i,column=0) nextbutton13=tix.Button(sframe,text="Visit",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visitbutton(mm13)) nextbutton13.grid(row=2*i,column=1) nextbutton1313=tix.Button(sframe,text="Compare",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visualizebutton(mm13)) nextbutton1313.grid(row=2*i,column=2) lbl1 = tix.Label(sframe, text="______________________________________________________________",font=("Arial Black",20)) lbl1.grid(row=2*i+1,column=0) except : pass i=14 try: mm14=coursefuncobjects[i] info=infofunc(mm14) lbl1 = tix.Label(sframe, text=info,font=("Arial Black",20)) lbl1.grid(row=2*i,column=0) nextbutton14=tix.Button(sframe,text="Visit",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visitbutton(mm14)) nextbutton14.grid(row=2*i,column=1) nextbutton1414=tix.Button(sframe,text="Compare",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visualizebutton(mm14)) nextbutton1414.grid(row=2*i,column=2) lbl1 = tix.Label(sframe, text="______________________________________________________________",font=("Arial Black",20)) lbl1.grid(row=2*i+1,column=0) except : pass i=15 try: mm15=coursefuncobjects[i] info=infofunc(mm15) lbl1 = tix.Label(sframe, text=info,font=("Arial Black",20)) lbl1.grid(row=2*i,column=0) nextbutton15=tix.Button(sframe,text="Visit",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visitbutton(mm15)) nextbutton15.grid(row=2*i,column=1) nextbutton1515=tix.Button(sframe,text="Compare",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visualizebutton(mm15)) nextbutton1515.grid(row=2*i,column=2) lbl1 = tix.Label(sframe, text="______________________________________________________________",font=("Arial Black",20)) lbl1.grid(row=2*i+1,column=0) except : pass i=16 try: mm16=coursefuncobjects[i] info=infofunc(mm16) lbl1 = tix.Label(sframe, text=info,font=("Arial Black",20)) lbl1.grid(row=2*i,column=0) nextbutton16=tix.Button(sframe,text="Visit",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visitbutton(mm16)) nextbutton16.grid(row=2*i,column=1) nextbutton1616=tix.Button(sframe,text="Compare",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visualizebutton(mm16)) nextbutton1616.grid(row=2*i,column=2) lbl1 = tix.Label(sframe, text="______________________________________________________________",font=("Arial Black",20)) lbl1.grid(row=2*i+1,column=0) except : pass i=17 try: mm17=coursefuncobjects[i] info=infofunc(mm17) lbl1 = tix.Label(sframe, text=info,font=("Arial Black",20)) lbl1.grid(row=2*i,column=0) nextbutton17=tix.Button(sframe,text="Visit",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visitbutton(mm17)) nextbutton17.grid(row=2*i,column=1) nextbutton1717=tix.Button(sframe,text="Compare",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visualizebutton(mm17)) nextbutton1717.grid(row=2*i,column=2) lbl1 = tix.Label(sframe, text="______________________________________________________________",font=("Arial Black",20)) lbl1.grid(row=2*i+1,column=0) except : pass i=18 try: mm18=coursefuncobjects[i] info=infofunc(mm18) lbl1 = tix.Label(sframe, text=info,font=("Arial Black",20)) lbl1.grid(row=2*i,column=0) nextbutton18=tix.Button(sframe,text="Visit",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visitbutton(mm18)) nextbutton18.grid(row=2*i,column=1) nextbutton1818=tix.Button(sframe,text="Compare",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visualizebutton(mm18)) nextbutton1818.grid(row=2*i,column=2) lbl1 = tix.Label(sframe, text="______________________________________________________________",font=("Arial Black",20)) lbl1.grid(row=2*i+1,column=0) except : pass i=19 try: mm19=coursefuncobjects[i] info=infofunc(mm19) lbl1 = tix.Label(sframe, text=info,font=("Arial Black",20)) lbl1.grid(row=2*i,column=0) nextbutton19=tix.Button(sframe,text="Visit",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visitbutton(mm19)) nextbutton19.grid(row=2*i,column=1) nextbutton1919=tix.Button(sframe,text="Compare",bd=2,bg='blue',fg='white',font=("Arial Black",15),command=lambda:visualizebutton(mm19)) nextbutton1919.grid(row=2*i,column=2) lbl1 = tix.Label(sframe, text="______________________________________________________________",font=("Arial Black",20)) lbl1.grid(row=2*i+1,column=0) except : pass # self.window.eval('tk::PlaceWindow %s center' % self.window.winfo_pathname(self.window.winfo_id())) self.window.mainloop()
#-*-coding=utf-8-*- import encodings encodings.normalize_encoding('utf_8') from tkinter import tix f = open("result.txt", "rt") x = f.read() f.close() x = x.split() num = len(x) root = tix.Tk() frame = tix.Frame(root) frame.pack() scrolledwin = tix.ScrolledWindow(frame) scrolledwin.pack(side="right", fill="y") scr = scrolledwin.window col = 0 line_mark = 0 row_ = 0 bigfont = ("Helvetica", "50", 'bold') for i in range(num): if col == 9: col = 0 row_ += 1 txt = x[i] globals()['btn{}'.format(i)] = tix.Button(scr, text="%s" % txt, bg="ivory", fg="brown", activebackground='yellow', activeforeground="blue") globals()['btn{}'.format(i)].config(font=bigfont)
def PopulateClass(self): TopFrame_ = tix.ScrolledWindow(self,scrollbar=Y) TopFrame_.pack(expand=YES,fill=BOTH) self.TopFrame = TopFrame_.window response = self.requesthandler.GetClassList(self.SeasonInfo[1][1]) if not "수강신청용" in response: showerror("","기기등록에 실패했습니다. 이는 주로 기기등록을 한지 1분도 안지나고 다시 기기등록을 시도하면 발생합니다. 1분 경과후 재시도해주세요.(request error)") else: myMenu = Menu(self.master) myMenu.add_command(label="본인정보 등록",command=self.AddPersonalInfo) myMenu.add_command(label="자동등록 설정",command=self.OnAutomate) myMenu.add_command(labe="큰 시계보기",command=self.ShowClock) self.Student_Name = StringVar() self.Student_ID = StringVar() self.AutoRegisterTime = IntVar() self.AutoRegisterInfo = StringVar() self.AutoRegisterInput = StringVar() #self.AutoRegisterList = {} self.Memo = StringVar() self.master.config(menu=myMenu) soup = bs4.BeautifulSoup(response,"html.parser") classes = [] table = soup.find("table",{"class":"table_box"}) rows = table.findAll("tr") for row in rows: vars = [] cols = row.findAll("td") if row.find("a"): vars.append(row.find("a").get("href")) else: vars.append(None) for items in cols: vars.append(items.text.strip()) classes.append(vars) classes.pop(0) class_increment = 1 Label(self.TopFrame,text="순번").grid(row=0,column=0) Label(self.TopFrame,text="학년").grid(row=0,column=1) Label(self.TopFrame,text="[선택군] 강좌 이름(내부 강좌 코드)").grid(row=0,column=2) Label(self.TopFrame,text="담당교사").grid(row=0,column=3) Label(self.TopFrame,text="신청/정원").grid(row=0,column=4) Label(self.TopFrame,text="수강료").grid(row=0,column=5) Label(self.TopFrame,text="바로신청").grid(row=0,column=6) Label(self.TopFrame,text="자동신청").grid(row=0,column=7) jsvalue = [] for class_info in classes: if class_increment == 2:print(class_info) if int(class_info[5].split("/")[0]) >= int(class_info[5].split("/")[1]): open_state = False else: open_state = True Label(self.TopFrame,text=class_info[1]).grid(row=class_increment,column=0) Label(self.TopFrame,text=class_info[2]).grid(row=class_increment,column=1) Label(self.TopFrame,text=class_info[3]+" ("+str(ast.literal_eval(class_info[0].split("bL")[1])[1] if class_info[0] != None else "None")+")").grid(row=class_increment,column=2) Label(self.TopFrame,text=class_info[4]).grid(row=class_increment,column=3) Label(self.TopFrame,text=class_info[5],fg="blue" if open_state else "red").grid(row=class_increment,column=4) Label(self.TopFrame,text=class_info[6]).grid(row=class_increment,column=5) jsvalue.append((ast.literal_eval(class_info[0].split("bL")[1]) if class_info[0] else None,class_increment-1)) Button(self.TopFrame,text="바로신청" if open_state else "마감",fg="blue" if open_state else "red",state=NORMAL if open_state else DISABLED,command=lambda class_increment=class_increment:self.RegisterClass(jsvalue[class_increment-1])).grid(row=class_increment,column=6) Button(self.TopFrame, text="자동신청" if open_state else "마감", fg="blue" if open_state else "red", state=NORMAL if open_state else DISABLED, command=lambda class_increment=class_increment: self.AutoRegisterClass(jsvalue[class_increment - 1],classes[class_increment-1])).grid(row=class_increment, column=7) class_increment += 1 showwarning("","신청에 성공했다고 하여도 프로그램 종료 후, 브라우저에서 보인아이에 접속하여 정상적으로 신청되었는지 꼭 확인해주세요.")
''' Created on 2019年6月19日 @author: bkd ''' #!/usr/bin/python from tkinter import * from tkinter import tix app = tix.Tk() app.title('exploring tix') # scr_win = tix.ScrolledWindow(app, width=200, height=300,scrollbar='y') scr_win = tix.ScrolledWindow(app, width=500, height=600) scr_win.pack(fill='both', expand=1) sframe = scr_win.window # sframe.config(bg='brown') s1 = '''Welcome to tkinter.tix, tkinter on steroids! Welcome to tkinter.tix, tkinter on steroids! Welcome to tkinter.tix, tkinter on steroids! Welcome to tkinter.tix, tkinter on steroids! Welcome to tkinter.tix, tkinter on steroids!Welcome to tkinter.tix, tkinter on steroids! Welcome to tkinter.tix, tkinter on steroids! Welcome to tkinter.tix, tkinter on steroids! Welcome to tkinter.tix, tkinter on steroids! Welcome to tkinter.tix, tkinter on steroids! Welcome to tkinter.tix, tkinter on steroids! Welcome to tkinter.tix, tkinter on steroids!
self.DataFrames_noZero['TimeDelta']).sum().total_seconds()) / (1000000 * float(self.PowderWeight.get()))) #def processRunData(self): #def convert_ax(ax_f): class scrapeThread(threading.Thread): def __init__(self, tkParent, threadID, name, counter, page): threading.Thread.__init__(self) self.tkParent = tkParent print(self.tkParent) self.threadID = threadID self.name = name self.counter = counter self.page = page def run(self): print("Starting " + self.name) self.tkParent.isRunning = True AttritorScrape.recordRunData(self.tkParent, self.page) print('Exiting ' + self.name) root = tk.Tk() scroll = tk.ScrolledWindow(root, scrollbar=tk.BOTH) scroll.pack(fill=tk.BOTH, expand=1) AttritorScrape(scroll.window).pack() root.mainloop()