We're doing a "virus" now and I was told to make a delay in my code. Help me, please. Here's the code:
import pygame
from tkinter import *
from tkinter import messagebox
import time
import random
pygame.init()
screen = pygame.display.set_mode((800, 300))
pygame.display.set_caption("ЗАРАЖЕНИЕ АЧЕ)")
Tk().wm_withdraw()
font = pygame.font.SysFont("Lucida Console", 35)
label2 = font.render("DELETING ALL PASSWORDS. . . . .", 1, (12, 140, 0, 1))
a = 0
while True:
screen.fill((0, 0, 0))
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
time.sleep(0.5)
screen = pygame.display.set_mode((800, 300))
pygame.display.set_caption("ЗАРАЖЕНИЕ АЧЕ)")
messagebox.showerror("ERROR!", " Вы попытались закрыть окно! Начинаю удаление файлов")
warning = f"Процент удаления: {a}"
label3 = font.render(warning, 1, (12, 140, 0, 1))
a = a + 1
time.sleep(0.1)
if a >= 100:
break
screen.blit(label2, (50, 50))
screen.blit(label3, (50, 100))
pygame.display.update()
My question is, I don't know which command to use to delay and where to put it.
Thank you in advance!