日経ソフトウエア 2020年 3 月号, pp.42ff.
pip自体をアップグレードしてから(しなくてもよい)、
py -m pip install -U pip
Pygame Zeroをpip
する。
py -m pip install pgzero
import pgzrun WIDTH = 318 HEIGHT = 212 def draw(): screen.clear() #((cx, cy), 半径, (r, g, b)) screen.draw.circle((WIDTH/2, HEIGHT/2), int(HEIGHT/2), "white") pgzrun.go()
circle
のほかにfilled_circle
, filled_rect
, line
, rect
, text
, textbox
。