我只是在学习如何使用Pygame,但是当我运行程序时,Pygame 窗口只是黑色并且没有矩形?任何人都可以帮忙吗?
import pygame, sys
from pygame.locals import *
pygame.init()
screen=pygame.display.set_mode((640,360),0,32)
while True:
for event in pygame.event.get():
if event.type==QUIT:
pygame.quit()
sys.exit()
screen.lock()
pygame.draw.rect (screen, (140,240,130), Rect((100,100), (130,170)))
screen.unlock()
pygame.display.update()