Python Forum
[Tkinter] Lambda seems to call expression 1 extra time every time it's called.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] Lambda seems to call expression 1 extra time every time it's called.
#6
(May-16-2019, 07:24 PM)micseydel Wrote: This is interesting. I looked a little bit but don't have time to deep-dive on this. If you can provide a runnable snippet of code which reproduces this problem without GUI code though (ideally zero imports), I'll make time to look deeper.

I don't think I can without a gui.

(May-16-2019, 07:53 PM)ichabod801 Wrote: I think you need to refigure how you are doing movement. When you click on something to move it, you should change it's state to 'trying to move to x, y'. Then you should periodically update your game. When you update things, you check every object for movement. If it is trying to move somewhere, you move it a little closer. If it gets there, change it's state to 'not moving'.

If I remove out the while loops and add this line in:
self.grid.move_players(players, spaces)
which is commented out in my code I provided, even though there is no yield, I still get the same problem. So correct me if I'm wrong but, changing the way I do movement, won't really do much.

D
Reply


Messages In This Thread
RE: Lambda seems to call expression 1 extra time every time it's called. - by DreamingInsanity - May-17-2019, 05:22 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Doubt approach update 2 Treeview at the same time TomasSanchexx 7 2,315 Sep-19-2023, 01:19 AM
Last Post: SaintOtis12
  Figure Gets Larger Every time I click a show button joshuagreineder 2 1,438 Aug-11-2022, 06:25 AM
Last Post: chinky
  tkinter get method is not accepting value when called by function jagasrik 1 2,646 Sep-16-2020, 05:28 AM
Last Post: Yoriz
  How to stop time counter in Tkinter LoneStar 1 4,593 Sep-11-2020, 08:56 PM
Last Post: Yoriz
  Display text 3 words at a time algae 5 2,950 Jun-27-2020, 10:25 AM
Last Post: menator01
Photo Visualizing time series data of graph nodes in plotly deepa 3 3,615 Mar-16-2020, 07:06 AM
Last Post: Larz60+
  [Tkinter] How to adjust time - tkinter Ondrej 2 2,970 Jun-20-2019, 05:53 PM
Last Post: Yoriz
  [Tkinter] Unable to create checkbox and select at run time tej7gandhi 5 4,856 May-05-2019, 04:57 PM
Last Post: tej7gandhi
  Buttons not appearing, first time button making admiral_hawk 5 3,543 Dec-31-2018, 03:26 AM
Last Post: admiral_hawk
  clear all widgets at same time (not delete/remove) shift838 0 2,828 Dec-17-2018, 11:55 PM
Last Post: shift838

Forum Jump:

User Panel Messages

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