Category : tkinter

from tkinter import * from tkinter import ttk root = Tk() root.geometry("600×400") root.resizable(False, False) def nameLength(event): str(input) length = input.split() length1 = len(garums) myLabel = Label(root, text=length1.get()).pack( ) choice = ("Word count", "Delete symbol", "Change 1st word with last word") options = StringVar() options.set("Choose an option") input = Entry(root) input.pack() menu = OptionMenu(root, options, *choice, ..

Read more

I have this: from tkinter import * import numpy as np rows = 10 columns = 10 width, height = rows*18, columns*18 window = Tk() window.geometry(str(width)+"x"+str(height)) window.resizable(width=False, height=False) window.config(background="#A9A9A9") field_frame = Frame(width=width, height=height, bg="#A9A9A9", colormap="new") field_frame.pack(side=BOTTOM) field_frame.grid_propagate(False) pixelVirtual = PhotoImage(width=1, height=1) #To measure the size in pixels btnarr = np.zeros(shape=(rows, columns), dtype=object) def button_click(row, column): ..

Read more

How can the on_change_order method in the following script be implemented? import tkinter as tk root = tk.Tk() # Inserts labels 1 and 2 in sequence, using .pack() method label1 = tk.Label(root, text="Label 1", bg="red", fg="white") label1.pack(padx=5, pady=15, side=tk.LEFT) label2 = tk.Label(root, text="Label 2", bg="green", fg="white") label2.pack(padx=5, pady=20, side=tk.LEFT) def on_change_order(): """Swaps the .pack() order ..

Read more