代码部分
import pygame
from threading import *
from pygame.locals import *
def main():
screen=pygame.display.set_mode((350,500),0,depth=32)
background=pygame.image.load('./pictu/background.png')
pygame.display.set_caption('飞机大战')
screen.blit(background, (0, 0))
pygame.display.update()
pass
if __name__ == '__main__':
main()
报错内容
Fatal Python error: pygame_parachute: (pygame parachute) Segmentation Fault
Python runtime state: initialized
Current thread 0x0000b050 (most recent call first):
File "D:\pythonmuzhou\pythonprojectplane\text.py", line 16 in main
File "D:\pythonmuzhou\pythonprojectplane\text.py", line 20 in <module>
Extension modules: pygame.base, pygame.constants, pygame.rect, pygame.rwobject, pygame.surflock, pygame.color, pygame.bufferproxy, pygame.math, pygame.surface, pygame.display, pygame.draw, pygame.event, pygame.imageext, pygame.image, pygame.joystick, pygame.key, pygame.mouse, pygame.time, pygame.mask, pygame.pixelcopy, pygame.transform, pygame.font, pygame.mixer_music, pygame.mixer, pygame.scrap, numpy.core._multiarray_umath, numpy.core._multiarray_tests, numpy.linalg._umath_linalg, numpy.fft._pocketfft_internal, numpy.random._common, numpy.random.bit_generator, numpy.random._bounded_integers, numpy.random._mt19937, numpy.random.mtrand, numpy.random._philox, numpy.random._pcg64, numpy.random._sfc64, numpy.random._generator, pygame.pypm, pygame._freetype (total: 40)
我想要达到的结果是一个被图片覆盖的窗口 ,但是报了这个错不知道为什么,在编写过程中没有报错但运行就报错了 步骤和教程一样 ,不知道是不是pygame有什么问题.,主要是这个Fatal Python error: pygame_parachute: (pygame parachute) Segmentation Fault不懂什么意思,程序是从这一步开始有问题的 screen.blit(background, (0, 0))