この正確な質問は、昨年 4 月にこのフォーラムで行われました。ただし、唯一の答えは次のとおりでした。だから私はこれを最初にチェックし、チェックアウトしました。(私は Python 2.7 と Python 2.7 用の Pygame バージョン 1.9.1 リリースを持っています。)
そうではありませんが、次のコードは、他の人が報告したのと同じエラーを生成します。
This application has requested the runtime to terminate it in an unusual way. Please contact the application's support team for more info.
私は困惑しているので、元のポスターがそれを修正するために何をしたかを言っていたらよかったのに. これを実行しようとしているマシンには管理者権限がないことに注意してください。それが問題でしょうか?
スクリプトは以下です。(これは、書籍Beginning Game Development with Python and Pygame から直接引用したものです。) ウィンドウのサイズを変更しようとする瞬間まで実行されます。
background_image_filename = 'sushiplate.jpg'
import pygame
from pygame.locals import *
from sys import exit
SCREEN_SIZE = (640, 480)
pygame.init()
screen = pygame.display.set_mode(SCREEN_SIZE, RESIZABLE, 32)
background = pygame.image.load(background_image_filename).convert()
while True:
event = pygame.event.wait()
if event.type == QUIT:
exit()
if event.type == VIDEORESIZE:
SCREEN_SIZE = event.size
screen = pygame.display.set_mode(SCREEN_SIZE, RESIZABLE, 32)
pygame.display.set_caption("Window resized to "+str(event.size))
screen_width, screen_height = SCREEN_SIZE
for y in range(0, screen_height, background.get_height()):
for x in range(0, screen_width, background.get_width()):
screen.blit(background, (x, y))
pygame.display.update()