basic tkinter gui
import tkinter as tk
root = tk.Tk()
root.title("my title")
root.geometry('200x150')
root.configure(background='black')
# enter widgets here
root.mainloop()
basic tkinter gui
import tkinter as tk
root = tk.Tk()
root.title("my title")
root.geometry('200x150')
root.configure(background='black')
# enter widgets here
root.mainloop()
tkinter code examples
from tkinter import *
window=Tk()
# add widgets here
window.title('Hello Python')
window.geometry("300x200+10+20")
window.mainloop()
gui in tkinter
from tkinter import *
import os
# window
window = Tk()
window.geometry("450x450")
window.title("Gui App")
window.configure(bg="powder blue")
# Enter or user input in tkinter
filename = Entry(window, width=75)
filename.pack()
# Run file Function
def runFile():
try:
os.startfile(filename.get())
except:
error = Label(window, text=f"No file found as {filename.get}")
error.pack()
# Run file button
open_file_button = Button(window, text="Run File", command=runFile)
open_file_button.pack()
window.mainloop()
how to create tkinter window
import tkinter
master = tkinter.Tk()
master.mainloop()
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us