This Tinter GUI toolkit program draws a rather ugly stick man ...
# exploring Tkinter's canvas drawing surface
# draw lines and ovals to form a stick man
# info at http://effbot.org/tkinterbook/canvas.htm
try:
# Python2
import Tkinter as tk
except ImportError:
# Python3
import tkinter as tk
def body(w, h):
"""draw the oval for the body"""
# an oval is drawn within a given rectangle
# (x1, y1, x2, y2) upper left and lower right corner coordinates
# of the rectangle the ellipse is bound by
# calculate coordinates relative to width w and height h
rect = (w//2-80, h//2-150, w//2+80, h//2+80)
canvas.create_oval(rect, fill='red')
def head(w, h):
"""draw the oval/circle for the head"""
# if the bounding rectangle is a square a circle is drawn
rect = (w//2-40, h//2-230, w//2+40, h//2-150)
canvas.create_oval(rect, fill='red')
def arms(w, h):
"""draw lines for right and left arm"""
# draw line from coordinate points x1, y1 to x, y2
# left arm
canvas.create_line(w//2-66, h//2-100, w//2-166, h//2-50)
# right arm
canvas.create_line(w//2+66, h//2-100, w//2+166, h//2-50)
def legs(w, h):
"""draw lines for right and left legs"""
# draw line from coordinate points x1, y1 to x, y2
# left leg
canvas.create_line(w//2-55, h//2+50, w//2-76, h//2+190)
# right leg
canvas.create_line(w//2+55, h//2+50, w//2+76, h//2+190)
# create the main window
root = tk.Tk()
root.title("Fred Stickman")
# create the drawing canvas
w = 400
h = 500
canvas = tk.Canvas(root, width=w, height=h, bg='white')
canvas.pack()
body(w, h)
head(w, h)
arms(w, h)
legs(w, h)
# start the GUI event loop
root.mainloop()
Should you be interested, experiment with the drawing and make Fred Stickman look more like a movie star.