install tkinter windows code example

Example 1: how to make a tkinter window

from tkinter import *

mywindow = Tk() #Change the name for every window you make
mywindow.title("New Project") #This will be the window title
mywindow.geometry("780x640") #This will be the window size (str)
mywindow.minsize(540, 420) #This will be set a limit for the window's minimum size (int)
mywindow.configure(bg="blue") #This will be the background color

mywindow.mainloop() #You must add this at the end to show the window

Example 2: install tkinter

pip3 install tk

Example 3: how to install tkinter

sudo apt-get install python3-tk

Example 4: how to install tkinter for python

# for pip and windows, in cmd, write:
pip install tk

Example 5: pip install tkinter

pip install tk

Example 6: how do i install tkinter on windows 7

pip install tk 
#or
pip3 install tk
python3 -m pip install tk