D
D
Dimast0002020-08-25 02:02:20
Flask
Dimast000, 2020-08-25 02:02:20

How to implement constant monitoring of a variable?

There is a variable images, it contains a list of images.
images= os.listdir('./output')

The Flask script displays images from this list on the page.
Right now the list of images is updated only after the page is reloaded.

How can I implement constant monitoring and updating of the images list so that images are displayed without refreshing the page?

image.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Shumov, 2020-08-25
@inoise

Ajax

K
kirillinyakin, 2020-08-25
@kirillinyakin

Use AJAX technology that will send a request to the server, and in response the server will return a new image

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question