Guy's
Here is one for the geeks out there.
I am going to use some Shellac as a grain filler and I wanted metric conversion for the process.
So having some time on my hands and wanting to learn something I have created python script to calculate it.
You will need python 2.7 to run it, it is built into the Macs and you can download it free for windows if you want.
save the following text as shellac.py and run it from the command line as "python shellac.py"
#######
#shellac.py
from tkinter import *
import Tkinter
window = Tk()
window.title("Metric Shellac Cut ratio Calculator")
#define labels
heading = Label(window, text = "Shellac Cut ratio Calculator", justify=LEFT)
rat_hed = Label(window, text = "Pick cut Ratio in Lbs/Gallons", justify=LEFT)
vol_hed = Label(window, text = "Pick desired alcohol volume in mls", justify=LEFT)
# define spinboxes
bt = Tkinter.Spinbox(window, width=5, values=(1,1.5,2,2.5,3,4))
# get value
def cut_ratio_value():
#print bt.get()
text_box = Tkinter.Text(window, width = 6, height = 1)
text_box.grid(row = 3, column = 1, columnspan = 1)
text_box.insert(END, round(float(119.8) * float(bt.get()) * float(vm.get()) * float(.001),1))
vm = Tkinter.Spinbox(window, width=5, values=(50,100,150,200,300,1000))
# calculate the volume
value_button = Tkinter.Button(window, text = 'Print Grams of Shellac per Litre', width = 25, command = cut_ratio_value)
#use grid no pack needed, columns are relative to other columns
#heading.grid(row=0, column=1, sticky = N)
rat_hed.grid(row=1, column=0, sticky = W)
vol_hed.grid(row=2, column=0, sticky = W)
# widget grids
bt.grid(column=1, row=1)
vm.grid(column=1, row=2)
value_button.grid(column=0, row=3)
#
window.mainloop()
### cut between the lines of ###'s
Bruce