Hi, I am trying to communicate python with node-red so that python knows the state of a variable that I receive by modbus.
Hi @ptatay, welcome to the forum.
Have you searched the forum - this has been covered many many times.
It does depend on how you are running python & what you are doing but the popular recommendation is to send your values to an MQTT broker and subscribe to the topic in your python code.