pygame没有出现

时间:2019-03-03 22:20:17

标签: python python-3.x pygame

我最近在Python中安装了PyGame,但是发生了一些奇怪的事情。当我导入它并在终端中使用它时,它可以正常工作,但是当我尝试在idle中使用它时,它根本不起作用。有人知道为什么会这样吗?

import pygame

pygame.init()

win = pygame.display.set_mode((500, 500))

退出并显示错误:

>Traceback (most recent call last):
  File "C:/Users/USER/PycharmProjects/Primer Python/Basico/pygame.py", line 1, in <module>
    import pygame
  File "C:\Users\USER\PycharmProjects\Primer Python\Basico\pygame.py", line 2, in <module>
    pygame.init()
AttributeError: module 'pygame' has no attribute 'init'

0 个答案:

没有答案
相关问题