def drawNetworkx(figure): Netw = Tk() Netw.wm_title("Network") #f = plt.Figure(figsize=(5,4), dpi=100) #a = f.add_subplot(111) #a.plot([1,2,3,4,5],[3,2,1,3,4]) #nx.draw_kamada_kawai(figure,with_labels=True, ax=a) canvas = FigureCanvasTkAgg(figure, master=Netw) canvas.draw() canvas.get_tk_widget().pack(side=TOP, fill=BOTH, expand=True) #toolbar = NavigationToolbar2Tk(canvas, Netw) #toolbar.update() #canvas.get_tk_widget().pack(side=TOP, fill=BOTH, expand=1) Netw.mainloop()
import tkinter as Tk root = Tk() root.wm_title("Login Window") root.config(background="#FFFFFF") class Application(Frame): def __init__(self, master): super(Application, self).__init__(master) #Set __init__ to the master class self.grid() self.create_main() #Creates function def create_main(self): print("testing") #Title self.title = Label(self, text=" Login Form ") self.title.grid(row=0, column=2) #Username Label self.user_entry_label = Label(self, text="Username: "******"Password: ") self.pass_entry_label.grid(row=2, column=1) #Password Entry Box self.pass_entry = Entry(self) self.pass_entry.grid(row=2, column=2) #Sign In Button
# msgauthor.pack() w.pack() passlabel = Label(master, text="Enter Encrypt/Decrypt Password:"******"*", width=20) passg.pack(padx=5, pady=5) self.encrypt = Button(master, text="Encrypt", bg="black", fg="white", command=image_open, width=25, height=2) self.encrypt.pack(side=LEFT, padx=5, pady=5) self.decrypt = Button(master, text="Decrypt", bg="black", fg="white", command=cipher_open, width=25, height=2) self.decrypt.pack(side=RIGHT, padx=5, pady=5) root = Tk() root.wm_title("Application") app = App(root) root.mainloop()