import pygame
import sys
import time
pygame.font.init()
sc = pygame.display.set_mode((300, 200))
sc.fill((255, 255, 255))
while 1:
for i in pygame.event.get():
if i.type == pygame.QUIT:
sys.exit()
sc.fill((255, 255, 255))
f1 = pygame.font.Font(None, 100)
thour = str(time.localtime().tm_hour)
tmin = str(time.localtime().tm_min)
tsec = str(time.localtime().tm_sec)
textTime = thour +":" + tmin + ":" + tsec
text1 = f1.render(textTime, True,(180, 0, 0))
sc.blit(text1, (10, 50))
pygame.display.flip()
|