# Is it possible to give a parameter to a running python script?

**URL:** <https://discourse.nodered.org/t/is-it-possible-to-give-a-parameter-to-a-running-python-script/76385>\
**Category:** General\
**Tags:** function-node, python\
**Created:** [10 March 2023 11:44 UTC](https://discourse.nodered.org/t/is-it-possible-to-give-a-parameter-to-a-running-python-script/76385 "2023-03-10T11:44:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![DeWoAlliSeged7](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dewoalliseged7/32/58702_2.png) [@DeWoAlliSeged7](https://discourse.nodered.org/u/DeWoAlliSeged7)\
**Post date:** [10 March 2023 11:44 UTC](https://discourse.nodered.org/t/is-it-possible-to-give-a-parameter-to-a-running-python-script/76385/1 "2023-03-10T11:44:47Z")

</div>

Hello

Is it possible to give a parameter to a running python script ?  
I would like to change a variable.

thx in advance  
Simon

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [10 March 2023 11:58 UTC](https://discourse.nodered.org/t/is-it-possible-to-give-a-parameter-to-a-running-python-script/76385/2 "2023-03-10T11:58:28Z")

</div>

> [@DeWoAlliSeged7](#):
>
> Is it possible to give a parameter to a running python script

Yes if the running script has a means of accepting input (e.g. listens to STDin or permits communication via MQTT or some other mechanism)

What is the python script doing? Did you write it?

---

<div class="post-metadata">

**Author:** ![DeWoAlliSeged7](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dewoalliseged7/32/58702_2.png) [@DeWoAlliSeged7](https://discourse.nodered.org/u/DeWoAlliSeged7)\
**Post date:** [10 March 2023 12:09 UTC](https://discourse.nodered.org/t/is-it-possible-to-give-a-parameter-to-a-running-python-script/76385/3 "2023-03-10T12:09:30Z")

</div>

Yes I wrote it.  
I will try it with MQTT!

THX!

---

<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:** [10 March 2023 13:22 UTC](https://discourse.nodered.org/t/is-it-possible-to-give-a-parameter-to-a-running-python-script/76385/4 "2023-03-10T13:22:38Z")

</div>

If you call it with the node- red-node-daemon node that pipes input to your stdin

---

<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:** [9 May 2023 13:22 UTC](https://discourse.nodered.org/t/is-it-possible-to-give-a-parameter-to-a-running-python-script/76385/5 "2023-05-09T13:22:41Z")

</div>

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