# Cant get a Python Script to work

**URL:** <https://discourse.nodered.org/t/cant-get-a-python-script-to-work/39797>\
**Category:** General\
**Created:** [26 January 2021 16:35 UTC](https://discourse.nodered.org/t/cant-get-a-python-script-to-work/39797 "2021-01-26T16:35:58Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![krambriw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/krambriw/32/5429_2.png) [@krambriw](https://discourse.nodered.org/u/krambriw)\
**Post date:** [27 January 2021 05:35 UTC](https://discourse.nodered.org/t/cant-get-a-python-script-to-work/39797/14 "2021-01-27T05:35:15Z")

</div>

If you search this forum you will find several discussions about python scripts and mqtt. I have even published some examples you can study, like this one

> [@Node-RED Dashboard: Some simple questions](https://discourse.nodered.org/t/node-red-dashboard-some-simple-questions/14538/27):
>
> This is a little xample with NR communicating with a python script using mqtt With "Go" you start the python script, then visible on the display From the dashboard you pick a number that is sent to the script, returned back and displayed as the result With "abort" you terminate the python script [{"id":"ea37930f.f3f81","type":"exec","z":"8627eb61.169ee8","command":"export DISPLAY=:0 && lxterminal -e python3 /home/pi/test.py","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":fa…

You can find more examples if you search for "python script mqtt"

---

_[View the full topic](https://discourse.nodered.org/t/cant-get-a-python-script-to-work/39797)._
