argument 1 must be 2-item sequence, not int

时间:2023-08-21 22:15:56

看了 https://blog.****.net/qq_18250439/article/details/80872425  的说明,才明白为什么错了。

当使用Python3-pygame时出现TypeError: argument 1 must be 2-item sequence, not int提示

原始代码:


screen =pygame.display.set_mode(SCREEN_WIDTH,SCREEN_HEIGHT)

应改为:

screen =pygame.display.set_mode((SCREEN_WIDTH,SCREEN_HEIGHT),0,32)

或者

screen =pygame.display.set_mode([SCREEN_WIDTH,SCREEN_HEIGHT])

感谢大神。