how to make pygame display random numbers? Of course, the goal is pursued by another, but I would like to understand this example.
import pygame from pygame.locals import * pygame.init() getSize = pygame.display.Info() screen = pygame.display.set_mode((getSize.current_w, getSize.current_h))#, pygame.FULLSCREEN) w = getSize.current_w h = getSize.current_h pygame.display.set_caption(''); fontSize = 20 myFont = pygame.font.SysFont('Calibri', fontSize) fontColor = (255,255,255) bgColor = (0,0,0) text = 'blablabla' fontImage = myFont.render(str(text), 9, (fontColor)) mainLoop = True while mainLoop: for event in pygame.event.get(): if event.type == QUIT: mainLoop = False screen.fill(bgColor) screen.blit(fontImage, (w / 2 - 50, h / 2)) pygame.display.update() pygame.quit() let's say so - how to connect these two pieces of code? I can not understand
import random import time a = random.randrange(1, 100) while a > 0: print(a) time.sleep(1) a = random.randrange(1, 100)