import pygame,sys
from pygame.locals import *
pygame.init()
DISPLAYSURF = pygame.display.set_mode((800,600))
#使用系统字体,或者自己加载字体库
myFont = pygame.font.SysFont("arial", 14)
words = myFont.render("hello world",True,(255,0,0))
while True:
DISPLAYSURF.fill((255,255,255))
for event in pygame.event.get():
if event.type == pygame.QUIT:
sys.exit()
DISPLAYSURF.blit(words,(0,0))
pygame.display.update()