What do you want to save?
Add Code snippet
New code examples
-
Python 2022-03-17 08:15:25
python tkinter focus on entry
from Tkinter import * root = Tk() frame=Frame(root,width=100,heigh=100,bd=11) frame.pack() label = Label(frame,text="Enter a digit that you guessed:").pack() entry= Entry(frame,bd=4) entry.pack() entry.focus() button1=Button(root,width=4,height=... Add solution -
Python 2022-03-16 12:25:11
python hoe to make a text box
import tkinter as tk root= tk.Tk() canvas1 = tk.Canvas(root, width = 400, height = 300, relief = 'raised') canvas1.pack() label1 = tk.Label(root, text='Calculate the Square Root') label1.config(font=('helvetica', 14)) canvas1.create_window(200, 25, wi... Add solution -
Python 2022-03-10 21:15:03
integrate label into listbox tkinter
import tkinter as tk # python3 root = tk.Tk() myList = tk.Listbox(root) myText = "A list item" myList.insert(tk.END, myText) myList.pack() lbl = tk.Label(myList, text=myText, anchor="w", font=("Helvetica", "24")) lb... Add solution -
Python 2022-02-20 07:10:07
change the color of the button on hovering tkinter
import tkinter as tk def on_enter(e): myButton['background'] = 'green' def on_leave(e): myButton['background'] = 'SystemButtonFace' root = tk.Tk() myButton = tk.Button(root,text="Click Me") myButton.grid() myButton.bind("<En... Add solution -
Python 2022-02-03 04:27:45
if statement with radio button python
from tkinter import * root = Tk() i = IntVar() #Basically Links Any Radiobutton With The Variable=i. r1 = Radiobutton(root, text="option 1", value=1, variable=i) r2 = Radiobutton(root, text="option 2", value=2, variable=i) # "&q... Add solution -
Python 2022-01-31 20:22:02
can tkinter have multiple windows open?
#import module needed import tkinter as tk #write the new window function which #will be called when button pressed def new_window(): window = tk.Toplevel(root) canvas = tk.Canvas(window, height=HEIGHT, width=WIDTH) canvas.pack() HEIGHT = 400... Add solution -
Python 2022-01-29 09:26:37
k-means
import tkinter as tk from tkinter import filedialog import pandas as pd from pandas import DataFrame import matplotlib.pyplot as plt from sklearn.cluster import KMeans from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg root= tk.Tk() canvas1... Add solution -
Other 2022-01-28 22:55:01
embed terminal/command prompt in tkinter window
import tkinter as tk from tkinter.messagebox import showwarning import subprocess root = tk.Tk() root.geometry("600x500") label = tk.Label(root, text="Example of xterm embedded in frame") label.pack(fill=tk.X) xterm_frame = tk.Frame... Add solution
Best helpers
Ranking is empty