Answers for "python graphical interface tkinter"

1

creating an interface tkinter

import tkinter as tk #tkinter is the library that we will use

class main:
  def __init__(self,master):
    master.title('Simple Interface') #This is the title
    master.geometry('500x500') #Our window will be a square
    master.configure(background='white') #Color of background
    master.resizable(False, False) #Resizable Off

if __name__ == '__main__':
  master = tk.Tk() #master is the name of our window
  main = main(master) #main is a class
  master.mainloop() #this is the loop
Posted by: Guest on July-25-2021
5

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()
Posted by: Guest on July-10-2020

Code answers related to "python graphical interface tkinter"

Python Answers by Framework

Browse Popular Code Answers by Language