Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/359.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在macos上启动pygame时出现问题在internet上找不到任何内容_Python_Pygame_Pycharm_Macos Catalina_Python 3.8 - Fatal编程技术网

Python 在macos上启动pygame时出现问题在internet上找不到任何内容

Python 在macos上启动pygame时出现问题在internet上找不到任何内容,python,pygame,pycharm,macos-catalina,python-3.8,Python,Pygame,Pycharm,Macos Catalina,Python 3.8,我没有语法或任何erorr的问题,这只是我运行程序时的一个问题 import pygame pygame.init() # generate window pygame.display.set_caption("shooter Game") pygame.display.set_mode((1080, 720)) running = True while running: # if the player close the window for event in pygame.even

我没有语法或任何erorr的问题,这只是我运行程序时的一个问题

import pygame
pygame.init()
# generate window
pygame.display.set_caption("shooter Game")
pygame.display.set_mode((1080, 720))
running = True
while running:
  # if the player close the window
   for event in pygame.event.get():
      if event.type == pygame.QUIT:
        running = False
        pygame.quit()
        print("game closed")

显示代码和时,您不会更新显示,这与您的操作有关
pygame.display.update()
您可以将其添加到
pygame.display.set_mode((1080720))

试着这样做,告诉我它是否有效:)

嘿,谢谢你回复我,但它仍然不起作用这不是代码问题窗口不想自己打开我可以给你发个屏幕录音你会看到我在说什么@bappit对我有效,当我运行时我有这个窗口你在macos上吗?你用什么来运行这个?