compilation error. AttributeError: 'module' object has no attribute 'init'

后端 未结 3 1196
迷失自我
迷失自我 2021-01-12 01:30

Here is my small program,

import pygame
pygame.init()

Here is my compilation command.

python myprogram.py

3条回答
  •  没有蜡笔的小新
    2021-01-12 02:01

    Rename pygame.py to another_name_as_pygame.py and this is your new Code:

    import pygame
    from pygame.locals import *
    pygame.init()
    

提交回复
热议问题