2
我試圖中心在使用Python 3.2中心矩形在新窗口
這裏新創建的窗口矩形是到目前爲止我的代碼:
from graphics import *
def plotSquare(win, side):
rect=Rectangle(Point(side//2,side//2), Point(side,side))
rect.setWidth(5)
rect.draw(win)
def main():
win=GraphWin("My Window", 500, 500)
win.setCoords(0, 0, 500, 500)
win.width=500
win.height=500
side=eval(input("What is the size of one side of the square (0<n<500): "))
plotSquare(win, side)
win.getMouse()
win.close
main()
我可以使用哪些功能居中長方形?
你是一個拯救生命的人,非常感謝! – 2014-10-11 16:02:45