# Python Funktion Stop

**URL:** <https://discourse.nodered.org/t/python-funktion-stop/66757>\
**Category:** General\
**Tags:** function-node\
**Created:** [22 August 2022 13:12 UTC](https://discourse.nodered.org/t/python-funktion-stop/66757 "2022-08-22T13:12:34Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![OPH](https://avatars.discourse-cdn.com/v4/letter/o/8c91f0/32.png) [@OPH](https://discourse.nodered.org/u/OPH)\
**Post date:** [22 August 2022 13:12 UTC](https://discourse.nodered.org/t/python-funktion-stop/66757/1 "2022-08-22T13:12:34Z")

</div>

Hi,  
I'm trying to stop python-function-node with a while loop in it. with a stop button on the dashboard. unfortunately i can't get the node to read in new msg. does anyone have an idea how i can solve this?

thanks for the help

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [22 August 2022 16:38 UTC](https://discourse.nodered.org/t/python-funktion-stop/66757/2 "2022-08-22T16:38:49Z")

</div>

Welcome to the forum.

It would help us to help you if you posted your flow here in the forum, and also explain  
what you are trying to do in a bit more detail.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [22 August 2022 18:20 UTC](https://discourse.nodered.org/t/python-funktion-stop/66757/3 "2022-08-22T18:20:13Z")

</div>

Which node are you using for this ? If you are calling out to a python app then either the exec node or daemon node should let you kill and restart the process.

---

<div class="post-metadata">

**Author:** ![OPH](https://avatars.discourse-cdn.com/v4/letter/o/8c91f0/32.png) [@OPH](https://discourse.nodered.org/u/OPH)\
**Post date:** [24 August 2022 08:37 UTC](https://discourse.nodered.org/t/python-funktion-stop/66757/4 "2022-08-24T08:37:00Z")

</div>

Hi,

thank you very much for your answer.  
I use the python function from the node-red-contrib-python-function package.

---

<div class="post-metadata">

**Author:** ![OPH](https://avatars.discourse-cdn.com/v4/letter/o/8c91f0/32.png) [@OPH](https://discourse.nodered.org/u/OPH)\
**Post date:** [24 August 2022 12:39 UTC](https://discourse.nodered.org/t/python-funktion-stop/66757/5 "2022-08-24T12:39:57Z")

</div>

thank you for your answer in the following my flow. unfortunately i can't publish the code because passwords etc. are in it.

 ![flow1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/a/aad83eaf29228365489a6d9a5e50df817771648f.png)  
 ![flow2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/b/0ba4fd556a817aabcd98f50f8ce2af19e87028cf.png)

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [24 August 2022 13:07 UTC](https://discourse.nodered.org/t/python-funktion-stop/66757/6 "2022-08-24T13:07:33Z")

</div>

Node-red is supposed to be a low-code programming system!

We can't tell which of those are python function nodes and which are the core (Javascript) function, but either way there seems to be an awful lot of them and very few of the other core nodes.  
Have you taken a look at [these videos](https://www.youtube.com/playlist?list=PLyNBB9VCLmo1hyO-4fIZ08gqFcXBkHy-6) to understand the Node-red way of doing things?

With regard to the python function, the help does say `THIS IS NOT READY FOR PRODUCTION YET!` and since it's not been updated for more than two years, it seems unlikely that it will ever be ready.

As @dceejay has mentioned, you can run external python scripts with the exec and daemon nodes which are part of the core.

---

<div class="post-metadata">

**Author:** ![OPH](https://avatars.discourse-cdn.com/v4/letter/o/8c91f0/32.png) [@OPH](https://discourse.nodered.org/u/OPH)\
**Post date:** [25 August 2022 14:36 UTC](https://discourse.nodered.org/t/python-funktion-stop/66757/7 "2022-08-25T14:36:48Z")

</div>

Hi jbudd

thanks for the answer. i am aware that i have not solved everything nod-red compliant. Actually i wanted to solve everything in python but i need a web interface. and node red offers a good and fast solution for that.

is it also possible to inagirate with the exec and daemon nodes with the dashboard ?

 ![ui](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/3/330e6f4a4597f8f40a285ec7306be208c3df28a9.png)

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [25 August 2022 14:50 UTC](https://discourse.nodered.org/t/python-funktion-stop/66757/8 "2022-08-25T14:50:40Z")

</div>

A good way to solve this might be to use MQTT to interface between your python process and the dashboard. Then you can implement your system in python completely independently of node-red, and have the dashboard running in node red communicating with the python process via MQTT.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [25 August 2022 19:20 UTC](https://discourse.nodered.org/t/python-funktion-stop/66757/9 "2022-08-25T19:20:55Z")

</div>

Actually Node-red does let you glue together all sorts of scripts and executables and at the same time it provides a basic dashboard.

So if you prefer python, by all means call your scripts from node-red. Except the python function mode may be the wrong way to do it.

I suppose it does give you the Monaco editor for your script. But in my humble opinion, anyone who thinks that's a good code editor has never experienced the joy of vi. 🤔

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [24 October 2022 19:20 UTC](https://discourse.nodered.org/t/python-funktion-stop/66757/10 "2022-10-24T19:20:57Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
