コードを実行して、マウスをドラッグして描画できるPygame画面を開きます。しかし、IDLEはいつも言う:Pygame "TypeError:builtin_function_or_methodではなく2項目のシーケンスでなければなりません"
Traceback (most recent call last):
File "D:/Python32/Pygame/draw", line 36, in <module>
pygame.draw.circle(screen,WHITE,spot,radius)
TypeError: must be 2-item sequence, not builtin_function_or_method
import pygame
pygame.init()
screen=pygame.display.set_mode([800,600])
pygame.display.set_caption("Draw lines")
WHITE=(225,225,225)
radius=10
mousedown=False
keep_going=True
while keep_going:
for event in pygame.event.get():
if event.type==pygame.QUIT:
keep_going=False
if event.type==pygame.MOUSEBUTTONDOWN:
mousedown=True
if event.type==pygame.MOUSEBUTTONUP:
mousedown=False
if mousedown:
spot=pygame.mouse.get_pos
pygame.draw.circle(screen,WHITE,spot,radius)
pygame.display.update()
pygame.quit()
また、コードを正しくフォーマットしてください。スペースを混ぜたタブを使用したようです。 [PEP 8](https://www.python.org/dev/peps/pep-0008/)では、スペースのみを使用することを推奨しています。ここで "編集"ウィンドウでコードを選択して "Ctrl-K"を押すだけで、他のインデントの問題があります。 – skrx