Помогите пожалуйста отредактировать. Пишет ошибка: IndentationError: expected an indented block

import tkinter as tk
from math import *

W = 600
H = 600
STEP = 20


def plt():
    f = entry.get()


x0 = W // 2 / STEP
x = -x0
try:
    y = 0
    y = eval(f.replace('x', '(' + str(x) + ')'))
except BaseException:
xp = x * STEP + W // 2
yp = H // 2 - y * STEP
while x <= x0:
    try:
        y = eval(f.replace('x', '(' + str(x) + ')'))
except BaseException:
y = 0
xc = x * STEP + W // 2
yc = H // 2 - y * STEP
canvas.create_line(xp, yp, xc, yc, fill="blue", )
xp, yp = xc, yc
x += 0.02

root = tk.Tk()
root.title("Plotter")
label = tk.Label(root, text='y=', width=4, bg='yellow')
entry = tk.Entry(root, width=80, bg='white', fg='black')
button = tk.Button(root, text="GO", command=plt, bg='#425472')
canvas = tk.Canvas(root, width=W, height=H, bg='white')
canvas.create_line(0, H // 2, W, H // 2, fill="blue", width=2)
canvas.create_line(W // 2, 0, W // 2, H, fill="blue", width=2)
canvas.pack(side="bottom")
label.pack(side="left")
entry.pack(side="left")
button.pack(side="left")
canvas.pack(side="bottom")
root.mainloop()

Ответы (0 шт):