how to create a window in python code example
Example 1: create window with python
from tkinter import *
app = Tk()
app.title("Test")
label = Label(app, text="Testing testing one, two, three")
label.pack()
app.mainloop()
Example 2: Window in python
import tkinter as tk
from tkinter import*
root = tk.Tk()
name = "First window"
root.title(name)
Button bt1 = Button(root, text = "Simple click");
def doer():
print("Did well");
Button bt2 = Button(root, text = "Function", command = doer)
bt1.pack()
bt2.pack()
root.mainloop()
Example 3: how to make a screen in python
import pygame
pygame.init()
sh = int(500)
sw = int(500)
win = pygame.display.set_mode((sh, sw))
run = True
while run:
pygame.time.delay(100)
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
Example 4: make a window tkinter
import Tkinter
top = Tkinter.Tk()
top.mainloop()