Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/336.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Python模块graphics.py,是否可以更改对象属性?_Python_Graphics - Fatal编程技术网

使用Python模块graphics.py,是否可以更改对象属性?

使用Python模块graphics.py,是否可以更改对象属性?,python,graphics,Python,Graphics,我正在学习使用John Zelle的图形模块Graphics.py 创建对象(如圆)后,是否可以更改圆的半径?我没有看到setRadius()方法,只有move()方法 那么,将圆的大小更改为undraw()并创建对象的新实例的唯一方法是什么 receptors = [] circles = [] for i in range(MAX_ITERATIONS): r = Receptor() receptors.append(r) print "No receptors:

我正在学习使用John Zelle的图形模块Graphics.py

创建对象(如圆)后,是否可以更改圆的半径?我没有看到setRadius()方法,只有move()方法

那么,将圆的大小更改为undraw()并创建对象的新实例的唯一方法是什么

receptors = []
circles = []

for i in range(MAX_ITERATIONS):
    r = Receptor()
    receptors.append(r)
    print "No receptors: ", Receptor.instances

    for j in range(Receptor.instances):
        c = Circle(receptors[j].centre, receptors[j].size)
        c.setFill('lightblue')
        circles.append(c)
        c.draw(win)

    update()
    # win.getMouse() # pause for click in window

    for j in range(Receptor.instances):
        receptors[j].grow()
        circles[j].undraw()

    # To-do:
    # do adjustments()

    del circles[:]