为什么此代码有错误“视频系统未初始化”?

时间:2018-09-25 19:06:16

标签: python pygame

#!/usr/bin/python3
import pygame
pygame.init()

img = pygame.image.load("/home/leo/Documents/Python/gru.jpg")
o = (255, 255, 255)
w= 700
h = 600

print("YOU WANNA SEE MA BOI GRU?")
print("YOu WANT TO?")
cool = input("DO YOU WANT TO?? (y) (n):\n")
if cool == "y":
  screen = pygame.display.set_mode((w,h))
  screen.fill((o))
  screen.blit(img,(0,0))
  pygame.display.flip()
  while True:
      for event in pygame.event.get():
          if event.type == pygame.QUIT:**strong text**
              pygame.quit()
else:
    print("aww you no wanna see gru :(((((((")
    quit()

代码可以正常工作,但是在程序在if块上完成时会弹出pygame.error:视频系统未初始化

0 个答案:

没有答案