Python Forum
[python] [Tkinter] Problem bidding combobox with np.array
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[python] [Tkinter] Problem bidding combobox with np.array
#4
It depends on what you are trying to do with
weights = np.array([a])
If you moved it to the function it would be created when the callback happens

def callback(event):
    a = [float(w1.get()),float(w2.get()),float(w3.get()),float(w4.get())]
    
    print(a)
    weights = np.array([a])
but you would not be able to access weights outside of the call back.

You would have a better time using classes for GUI code.
Reply


Messages In This Thread
RE: [python] [Tkinter] Problem bidding combobox with np.array - by Yoriz - Aug-04-2019, 11:07 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyQt] How can I sync Combobox index to other combobox index? nickzsche 2 2,382 Jan-03-2022, 12:29 PM
Last Post: Axel_Erfurt
  Python3 tkinter radiobutton problem Nick_tkinter 14 6,015 Feb-15-2021, 11:01 PM
Last Post: Nick_tkinter
  tkinter python button position problem Nick_tkinter 3 3,558 Jan-31-2021, 05:15 AM
Last Post: deanhystad
Question [Tkinter] Can I set background color for each item in tkinter Combobox? water 1 5,119 Dec-10-2020, 07:48 PM
Last Post: Larz60+
  [Tkinter] ClockIn/Out tkinter problem Maryan 2 2,203 Oct-12-2020, 03:42 AM
Last Post: joe_momma
  tkinter| listbox.insert problem Maryan 3 3,511 Sep-29-2020, 05:34 PM
Last Post: Yoriz
  Convert combobox user input in to date with tkinter Ame 8 6,763 Jul-01-2020, 09:40 PM
Last Post: Yoriz
  Tkinter problem DPaul 6 4,133 May-28-2020, 03:40 PM
Last Post: DPaul
  [PyQt] Control a combobox from another python file PyQt5 prath 0 2,275 May-05-2020, 03:22 PM
Last Post: prath
  [Tkinter] Tkinter - I have problem after import varaible or function from aGUI to script johnjh 2 2,580 Apr-17-2020, 08:12 PM
Last Post: johnjh

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020