import pygame
import sys
pygame.init()
width,height = (600,400)
window = pygame.display.set_mode((width,height)) # this makes the window
pygame.display.set_caption('AnyTitle') #this makes a new title for the window
while True:
for event in pygame.event.get(): #looping through the events in pygame
if event.type == pygame.QUIT: #checking if the user has clicked the close button
pygame.quit() # this quits pygame and closes window
sys.exit() # for smooth closing