#!/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:视频系统未初始化