python screen code example
Example 1: 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 2: turtle graphics in python
from turtle import *
color('red', 'yellow')
begin_fill()
while True:
forward(200)
left(170)
if abs(pos()) < 1:
break
end_fill()
done()