我在'pygame.draw.circle'行上遇到语法错误:

时间:2013-03-13 21:45:17

标签: python python-3.x

我在'pygame.draw.circle'行上遇到语法错误:

screen.fill((0,0,100))
pos_x = 300
pos_y = 250
radius = 250
angle = 360
white = (255,255,255)



for n in range(1,13): 
    angle = math.radians( n * (360/12) - 90 )
    x = math.cos( angle ) * (radius-20) - 10
    y = math.sin( angle ) * (radius-20) - 10
    print_text(font, pos_x+x, pos_y+y, str(n)

pygame.draw.circle(screen, white, (pos_x, pos_y), radius, 6)
pygame.display.flip()    `

1 个答案:

答案 0 :(得分:1)

您忘记关闭上一行的括号:

print_text(font, pos_x+x, pos_y+y, str(n)  # < one more closing parens needed.

纠正于:

print_text(font, pos_x+x, pos_y+y, str(n))

如果出现语法错误,请检查上一个行,以确保括号平衡。