1
我將如何建立一個Tkinter的窗口座標(500×500大小),這樣的(0,0)點在左下角,而(500×500)是在右上角?谷歌沒有太多的幫助。設置的Tkinter窗口的座標
def graphDisplay(distance, elevation):
'''draws up the graph.'''
#creates a window
root = Tk()
#sets the name of the window
root.title("Graph")
#sets the size of the window
root.geometry("500x500")
#sets the background of the window
root.configure(background='green')
#create a canvas object to draw the circle
canvas = Canvas(root)
#runs the program until you click x
root.mainloop
不要忘記在最後調用'mainloop',用:'root.mainloop()' –