Interacting with Plugin via external script

So I currently have a plugin that calls on an external JS to fire a python script. Is there any way that the python or an external JS can communicate with plugin?

Mostly just trying to see if once the python is finished it can then run batchplay after it’s finished. Not the end of the world if it’s not possible yet.