【发布时间】:2017-01-15 06:39:20
【问题描述】:
我是 pygame 的新手,遇到这个错误,请帮助我。
backgrounf_image_filename = 'ubisoft.jpg'
mouse_image_filename = 'cursor.png'
import pygame
from pygame.locals import *
from sys import exit
pygame.init()
screen = pygame.display.set_mode((640, 480), 0, 32)
pygame.display.set_caption("Hello World!")
background = pygame.image.load(backgrounf_image_filename).convert()
mouse_cursor = pygame.image(mouse_image_filename).convert_alpha()
我有这个错误:
Traceback (most recent call last):
File "C:/Users/ziyaa/PycharmProjects/pygame/helloworld.py", line 13, in <module>
mouse_cursor = pygame.image(mouse_image_filename).convert_alpha()
TypeError: 'module' object is not callable
Process finished with exit code 1
【问题讨论】:
-
第一篇文章和完整的堆栈跟踪包括:这很值得赞成和回答:)
-
正如有人指出的那样,您的缩进最后有点偏离。您可能会遇到问题(但这与问题无关,我将其编辑掉)
标签: python python-3.x pygame