一、
1、图形显示
2、图形用户界面:Graphical User Interface,GUI
3、安装graphics库
安装在D:\Python3\Lib\site-packages,网址http://mcsp.wartburg.edu/zelle/python/graphics.py
4、graphics库
(1)创建图形窗口
图形窗口
点(像素)的集合
GraphWin对象尺寸默认值:高200像素,宽200像素。
参考坐标系
简洁形式
(2)点
移动点
move(x,y)方法
清除原来点的图像,并在新位置重新绘制
两个数字参数:x,y
(2)圆
from graphics import * win=GraphWin() leftEye=Circle(Point(80,80),5) leftEye.setFill("yellow") leftEye.setOutline("red") rightEye=leftEye rightEye.move(40,0) leftEye.draw(win) rightEye.draw(win)