# NYstax 0.1.0

# Created by Jason Capron

# Licenced under the GPL (Check your Python folder, including it here would be like appending a dictionary to a post-it note)

.

from Tkinter import *

root=Tk()

.

def but1():

....a=float(v.get())

....a2 = a*.08

....b = (a+a2)

....w.delete(1.0,END)

....print w.insert(INSERT,a2)

....y.delete(1.0,END)

....print y.insert(INSERT,b)

.

v = StringVar()

w = Text(root,height=1, width=20)

w.grid(row=1, column=1)

TaxLab = Label(root, text="Tax")

TaxLab.grid(row=1, column=0)

y = Text(root, height=1, width=20)

y.grid(row=2, column=1)

TotLab = Label(root, text="Total with Tax")

TotLab.grid(row=2, column=0)

x = Label(root, text="Amount to convert")

x.grid(row=0, column=0)

e = Entry(root,textvariable=v, width=20)

e.grid(row=0,column=1)

b1 = Button(root,text="Calculate sales tax",command=but1)

b1.grid(row=3,columnspan=3)

.

root.mainloop()

What gave me migranes was getting the button to work after adding the grid code.

I was lumping things together like this

"b1 = Button(root,text="Calculate sales tax",command=but1).grid(row=3,columnspan=3)

Instead of using two lines like this,

"b1 = Button(root,text="Calculate sales tax",command=but1)

b1.grid(row=3,columnspan=3)"

To modify this scipt for your own state sales tax, just change "a2 = a*.08" (Line 11) to whatever the rate for sales tax is in your area. New Yorks is 8%, so the mulitplyer is .08

## Error