首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >pygame (pygame.init())出错

pygame (pygame.init())出错
EN

Stack Overflow用户
提问于 2016-07-11 21:41:54
回答 0查看 4.7K关注 0票数 0

我在使用Pygame时遇到一个错误。我使用的是Python3.5和PyGame3.2。我今天才开始学习Pygame,它给了我这个错误:

代码:

代码语言:javascript
复制
import pygame

pygame.init()
width, height = 640, 480
screen=pygame.display.set_mode((width, height))

player = pygame.image.load("resources/images/dude.png")


while 1:
    screen.fill(0)
    screen.blit(player, (100,100))
    pygame.display.flip()

    for event in pygame.event.get():
        if event.type==pygame.QUIT:
            pygame.quit() 
            exit(0)

错误:

代码语言:javascript
复制
Traceback (most recent call last):
File "test.py", line 5, in <module>
pygame.init()
AttributeError: module 'pygame' has no attribute 'init'
EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38308518

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档