-
gendalus
Hi everybody,
in a script that works like a digital picture frame I'm using the ImageView.load_from_url and I'm running into some problems.
The script is running on a loop, fetches picture posts from an API an displays them. The problem starts when a URL shows up a second time. Loading a picture that has been loaded before causes Pythonista to freeze.
It is totally possible to store the reference to the loaded image using
pictures[url] = image_view.image
in the next cycle of the loop. But there's some bookkeeping to be done to know what was the URL of the last loaded url …
So now I'm wondering if there's another way of doing it, that is more straight forward. I thought of something like a callback when the image has been downloaded, but I would not know how to do that. Is there something I'm missing?
-
gendalus
Hi there,
I'm currently working on a project what should call an API about every minute (the exact timing is not that important). In order to do it I have a while loop wich is paused after each loop for 60 seconds.
def loop(): while True: update() time.sleep(60) loop()
Is there any better way to do this? It seems, that when I'm running the script and the script is actually paused you can't stop the script with tapping on the [x]. It seems to be waiting for the sleep to end and is terminating after that.