1from tkinter import *
2
3mywindow = Tk() #Change the name for every window you make
4mywindow.title("New Project") #This will be the window title
5mywindow.geometry("780x640") #This will be the window size (str)
6mywindow.minsize(540, 420) #This will be set a limit for the window's minimum size (int)
7mywindow.configure(bg="blue") #This will be the background color
8
9mywindow.mainloop() #You must add this at the end to show the window
1#Creating Tkinter Window In Python:
2
3from tkinter import *
4
5new_window = Tk() #Create a window ; spaces should be denoted with underscores ; every window should have a different name
6new_window.title("My Python Project") #Name of screen ; name should be the one which you already declared (new_window)
7new_window.geometry("200x150") #Resizes the default window size
8new_window.configure(bg = "red") #Gives color to the background
9
10new_window.mainloop() #Shows the window on the screen
1import tkinter as tk
2
3window = tk.Tk() #Creates a window
4window.title("Trial") # Sets a title for the window
5window.geometry(520,850)# Size of window optional
6window.minisize(520,850) # Minimum size of window
7
8window.mainloop()# Sets visiblility to true
1#!/usr/bin/python
2
3import Tkinter
4top = Tkinter.Tk()
5# Code to add widgets will go here...
6top.mainloop()