Answers for "tkinter windows"

2

how to install tkinter on windows 10

no need to install it. It is usually preinstalled by default. Make sure you
write tkinter correctly (with capital letter T on versions less than python 3)
while importing
Posted by: Guest on September-13-2021
1

tkinter window

from tkinter import *

root = Tk()
root.geometry("500x500")
root.title("My App")
root.config(bg="#ff0000")

def printhi(*args):
	print("Hi!")
    
btn = Button(root, text="Click to print hi", command=printhi)
btn.place(x=200, y=200)

root.mainloop()
Posted by: Guest on August-05-2021
13

tkinter python 3

import tkinter as tk

obj = tk.Tk() # Creates a tkinter object
label = tk.Label(obj, text="This is a text button")
Posted by: Guest on February-01-2020
0

basic tkinter window

from tkinter import *

root = Tk()
root.title("Hello World")
message_label = Label(root, text="Hello World")
message_label.pack()

root.mainloop()
Posted by: Guest on September-28-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language