how to make a window with python code example

Example 1: create window with python

# basic setup
from tkinter import *

app = Tk() # the application itself
app.title("Test") # title of window

label = Label(app, text="Testing testing one, two, three") # creates label
label.pack() # adds the label to the window

app.mainloop() # this must go at the end of your window code

Example 2: Window in python

#If using tkinter
import tkinter as tk
from tkinter import*
#Window creating
root = tk.Tk()
# Defining name
name = "First window"
# Setting window
root.title(name)
# IF want to use geometry So let me tell that no need of that at all
# Tkinter sets the window according to data or things inside it
# Adding button
Button bt1 = Button(root, text = "Simple click");
# Making function
def doer():
  # Print is for console
  print("Did well");
# Adding button with function
Button bt2 = Button(root, text = "Function", command = doer)
# If you will add () it after brackets it will run automatically
# Adding buttons
bt1.pack()
bt2.pack()
root.mainloop()
# This can show error If using pycharm reformat file
# Set it as you are best