FHIR Chat · sleep() and Tk · python

Stream: python

Topic: sleep() and Tk


view this post on Zulip René Spronk (Feb 16 2022 at 15:59):

I'm not a regular Tk user, i do use a script to display a subset of FHIR resources (which is occasionally updated by third party systems) using a ttk.TreeView. Structure is akin to the following pseudocode:

ws = Tk()
While True:
window.delete current rows
use FHIR to get hold of new list of resource data, multiple rows
window.insert new rows
ws.update()
sleep(30)

..which works fine. On windows (not on Linux) the window quite often states (Not responding) in its title, which is probably caused by sleep(30) (?!). Polling every 30 secs makes sense in this context. Is this behavior caused by sleep() and if so, how to circumvent the issue ?

view this post on Zulip René Spronk (Feb 17 2022 at 14:09):

I found a hint to use ws.after..

view this post on Zulip René Spronk (Feb 22 2022 at 07:54):

.. which somehow didn't work for me. looping "sleep(1) ws.update()" works fine however


Last updated: Apr 12 2022 at 19:14 UTC