try:
    import tkinter
except ImportError: #phyton
    import tkinter
# def python_food():
#     width = 80
#     text = "spam and eggs"
#     left_margin = (width - len(text))//2
#     print(" " * left_margin,text)
#
# def centerText(txt):
#     left_margin = (80-len(txt))//2
#     print(" " * left_margin,txt);
#
# centerText("span and eggs")
# centerText("span,span and eggs")

def parabola(x):
    y =x*x /100
    return y;

def draw_axes(canvas):
    canvas.update()
    x_origin = canvas.winfo_width()/2
    y_origin = canvas.winfo_height()/2
    canvas.configure(scrollregion=(-x_origin,-y_origin,x_origin,y_origin))
    canvas.create_line(-x_origin,0,x_origin,0,fill="black")
    canvas.create_line(0,-y_origin,0,y_origin,fill="black")

def plot(canvas,x,y):
    canvas.create_line(x,y,x+1,y+1,fill="blue")

mainWindow = tkinter.Tk()
mainWindow.title("Parabola")
mainWindow.geometry("640x480")
canvas = tkinter.Canvas(mainWindow,width=640,height=480)
canvas.grid(row=0,column=0)
draw_axes(canvas)

for x in range(-100, 100):
    y = parabola(x);
    plot(canvas,x,-y)

mainWindow.mainloop()