import pygame
import sys
import random
mytext = "Привет,программер!"
pygame.font.init()
sc = pygame.display.set_mode((500, 500))
f1 = pygame.font.Font(None, 36)
counter = 0
while 1:
for event in pygame.event.get():
if event.type == pygame.QUIT:
sys.exit()
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_RETURN:
pygame.image.save(sc, "image.jpg")
sc.fill((255, 255, 255))
surf = pygame.Surface((500, 500))
for k in range(0,len(mytext)):
f1 = pygame.font.Font(None, random.randint(45,75))
text1 = f1.render(mytext[k], True,(180, 0, 0))
surf.blit(text1, (k*25,50))
sc.blit(surf, (0,0))
pygame.display.update()
|