#!/bin/python
import pygame, sys
import random
green = (0, 255, 0)
blue = (0, 0, 128)
red = (255, 0, 0)
pygame.init()
sc = pygame.display.set_mode((500, 500))
pygame.display.set_caption("Что-нибудь рисуем на pygame")
clock = pygame.time.Clock()
while True:
sc.fill((125,125,125))
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
pygame.draw.line(sc, (0,0,0), [300, 50], [300, 450], 3)
pygame.draw.line(sc, (0,0,0), [300, 50], [400, 250], 3)
pygame.draw.line(sc, (0,0,0), [100, 50], [100, 450], 3)
pygame.draw.line(sc, (0,0,0), [40, 250], [400, 250], 3)
pygame.draw.line(sc, (0,0,0), [40, 250], [100, 450], 3)
pygame.draw.line(sc, (0,0,0), [400, 250], [300, 450], 3)
pygame.draw.line(sc, (0,0,0), [100, 50], [40, 250], 3)
pygame.display.flip()
pygame.image.save(sc, "image.png")
|