Aug-04-2019, 10:40 AM
I want to include combobox values into np.array taken from function but it does not work. Could you please help me to make it workable. I will appreciate your help.
import tkinter as tk from tkinter.ttk import * import numpy as np import pandas as pd from scipy.stats import norm master = tk.Tk() v = tk.IntVar() combo = Combobox(master) def callback(event): a = [float(w1.get()),float(w2.get()),float(w3.get()),float(w4.get())] print(a) w1 = Combobox(master) w1['values']= (0.2,0.3,0.4,0.1) w1.current(0) #set the selected item w1.grid(row=3, column=2) w2= Combobox(master) w2['values']= (0.2,0.3,0.4,0.1) w2.current(0) #set the selected item w2.grid(row=4, column=2) w3= Combobox(master) w3['values']= (0.2,0.3,0.4,0.1) w3.current(0) #set the selected item w3.grid(row=5, column=2) w4= Combobox(master) w4['values']= (0.2,0.3,0.4,0.1) w4.current(0) #set the selected item w4.grid(row=6, column=2) w4.bind("<<ComboboxSelected>>", callback) weights = np.array([a]) master.mainloop()