Python Forum
Tkinter won't run my simple function
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tkinter won't run my simple function
#4
Are you passing the arguments to insert in the right order? The error message it telling you something about the arguments is wrong (the TclError in the traceback). Did you check the docs for insert?

Also, a small thing: on line 37, you don't need the lambda. A lambda is just a function literal (in the same way as "blue" is a string literal) and all you're doing there is creating a function that takes no arguments and calls shake. shake is itself a function that takes no arguments, so you can just pass it as the command instead of wrapping it in another function (i.e. command=shake).
AthertonH likes this post
Reply


Messages In This Thread
Tkinter won't run my simple function - by AthertonH - May-02-2022, 02:52 AM
RE: Tkinter won't run my simple function - by ndc85430 - May-02-2022, 05:22 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Using Tkinter inside function not working Ensaimadeta 5 5,233 Dec-03-2023, 01:50 PM
Last Post: deanhystad
  help needed running a simple function in pyqt5 diodes 27 8,846 Jan-24-2023, 12:19 PM
Last Post: GetOnData
  simple tkinter question function call not opening image gr3yali3n 5 3,605 Aug-02-2022, 09:13 PM
Last Post: woooee
  [Tkinter] tkinter best way to pass parameters to a function Pedroski55 3 5,017 Nov-17-2021, 03:21 AM
Last Post: deanhystad
  Creating a function interrupt button tkinter AnotherSam 2 5,669 Oct-07-2021, 02:56 PM
Last Post: AnotherSam
  [Tkinter] Have tkinter button toggle on and off a continuously running function AnotherSam 5 5,150 Oct-01-2021, 05:00 PM
Last Post: Yoriz
  tkinter get function finndude 2 3,040 Mar-02-2021, 03:53 PM
Last Post: finndude
  tkinter -- after() method and return from function -- (python 3) Nick_tkinter 12 7,704 Feb-20-2021, 10:26 PM
Last Post: Nick_tkinter
  function in new window (tkinter) Dale22 7 5,377 Nov-24-2020, 11:28 PM
Last Post: Dale22
Star [Tkinter] How to perform math function in different page of Tkinter GUI ravaru 2 4,673 Oct-23-2020, 05:46 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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