# NodeRED and python

**URL:** https://discourse.nodered.org/t/nodered-and-python/15517
**Category:** General
**Created:** [13 September 2019 15:58 UTC](https://discourse.nodered.org/t/nodered-and-python/15517 "2019-09-13T15:58:07Z")
**Posts on this page:** 1
**Showing post:** 12

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [13 September 2019 18:18 UTC](https://discourse.nodered.org/t/nodered-and-python/15517/12 "2019-09-13T18:18:36Z")

</div>

Just to clarify, the python script is run completely independently of Node-RED? It is not Node-RED that will be starting the script.

But when the script does run, you want its output to get to Node-RED in some form.

In which case you need to use some form of interprocess communication. A few options have already been mentioned; the python script could publish messages to a local MQTT broker (eg mosquitto) and have Node-RED subscribe to those messages. That would fully decouple the running of the script from Node-RED receiving its output. You could configure a Node-RED flow to listen on a TCP port for incoming connections - your python script could connect to that port and write its data.

There are lots of options - all depends which approach you feel comfortable with.

---

_[View the full topic](https://discourse.nodered.org/t/nodered-and-python/15517)._
