【发布时间】:2011-04-11 20:05:34
【问题描述】:
我有这个:
if colorkey is not None:
if colorkey is -1:
colorkey = image.get_at((0,0))
image.set_colorkey(colorkey, RLEACCEL)
return image, image.get_rect()
它告诉我“返回”在函数之外。
当我把它改成这样时:
if colorkey is not None:
if colorkey is -1:
colorkey = image.get_at((0,0))
image.set_colorkey(colorkey, RLEACCEL)
return image, image.get_rect()
它只是告诉我有一个意外的缩进。我该如何解决这个问题?
【问题讨论】:
-
这些语句在函数内部吗?
-
无法阅读。请正确格式化您的代码。
-
您可以编辑您的帖子以正确排版代码并显示文件中的缩进吗? (缩进 4 个空格以将其呈现为代码)
-
完成。现在应该可以阅读了。
-
您说它们在函数内部,但您没有发布函数定义。查看整个函数、定义和主体,将帮助我们告诉您哪里出了问题。
标签: python return indentation