# Passing arguments to a python file using node-red

**URL:** <https://discourse.nodered.org/t/passing-arguments-to-a-python-file-using-node-red/62950>\
**Category:** General\
**Created:** [23 May 2022 06:30 UTC](https://discourse.nodered.org/t/passing-arguments-to-a-python-file-using-node-red/62950 "2022-05-23T06:30:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vedant](https://avatars.discourse-cdn.com/v4/letter/v/ba9def/32.png) [@Vedant](https://discourse.nodered.org/u/Vedant)\
**Post date:** [23 May 2022 06:30 UTC](https://discourse.nodered.org/t/passing-arguments-to-a-python-file-using-node-red/62950/1 "2022-05-23T06:30:55Z")

</div>

![B](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/c/4c38b04722d4832171eb843221cbc1f16b3837da.png)  
Hello Everyone! I have created a python file where I have written some sys.argv arguments and in a javascript file I have created a node and exported to node-red, using this js file I pass in the arguments to the python script. I want to directly pass the arguments to the python file using node-red how is that possible?

I am trying to connect to a controller and request some data from it. I am providing some images for your reference. Thank You!!

 ![API node-red](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/8/f8f5cc7002d0fcc51f68460ea72be0fe353df202.png)  
 ![result node-red](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/e/1edf54505cdde9948ce119a53c57b50c15aa7f3f.png)  
 ![A](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/2/f24f86c4cbcc58790566440e5d6c318d54635921.png)

---

<div class="post-metadata">

**Author:** ![edje11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/edje11/32/572_2.png) [@edje11](https://discourse.nodered.org/u/edje11)\
**Post date:** [23 May 2022 06:49 UTC](https://discourse.nodered.org/t/passing-arguments-to-a-python-file-using-node-red/62950/2 "2022-05-23T06:49:15Z")

</div>

Why all the hassle with the python script for some UDP communication.  
Isn't it easier to use the NR UDP nodes?

---

<div class="post-metadata">

**Author:** ![Vedant](https://avatars.discourse-cdn.com/v4/letter/v/ba9def/32.png) [@Vedant](https://discourse.nodered.org/u/Vedant)\
**Post date:** [23 May 2022 06:51 UTC](https://discourse.nodered.org/t/passing-arguments-to-a-python-file-using-node-red/62950/3 "2022-05-23T06:51:12Z")

</div>

it is part of a project so I have been told to do it this way

---

<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:** [22 July 2022 06:51 UTC](https://discourse.nodered.org/t/passing-arguments-to-a-python-file-using-node-red/62950/4 "2022-07-22T06:51:23Z")

</div>

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