Update Theia from python script?

I’m working on a library in python that generates images in python I would like Theia to display using a plugin we are writing that contains a web view.

What’s the best way for python to communicate back to Theia that it has updated a png image, that we want our custom plugin to show to the user.

@stuaxo thank you for the discussion, I assume you are creating a vscode plugin which will spawn a python script? Perhaps if python were to update an image somehow on the filesystem you can rely on filesystem events from your plugin to know that something has changed and to re-render for instance?

Filesystem events can definitely work.

This is python code that can either run in the terminal in Theia, or using the default VSCode Python plugin (I think - I am pretty new to Theia).

I’ve made a plugin for matplotlib that outputs images to a directory I specify.
It would be nice if there is a way I could callback to Theia via a socket, as I can do that when all the images are ready - I guess with filesystem events it won’t know when all the images have been output unless I use a workaround like outputting a special file.