# Communication between Gateway Jython Script and External Python Script

**URL:** <https://forum.inductiveautomation.com/t/communication-between-gateway-jython-script-and-external-python-script/31139>\
**Category:** Ignition\
**Created:** [January 8, 2020, 11:24am UTC](https://forum.inductiveautomation.com/t/communication-between-gateway-jython-script-and-external-python-script/31139 "2020-01-08T11:24:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![emilien.legrand](https://avatars.discourse-cdn.com/v4/letter/e/848f3c/32.png) [@emilien.legrand](https://forum.inductiveautomation.com/u/emilien.legrand)\
**Post date:** [January 8, 2020, 11:24am UTC](https://forum.inductiveautomation.com/t/communication-between-gateway-jython-script-and-external-python-script/31139/1 "2020-01-08T11:24:36Z")

</div>

Hello,

I understand scripting in ignition is based on Jython and therefore such library like SciPy, NumPy and Pandas cannot be imported.

As a workaround, is there a way to perform the following from a Jython ‘Web Dev’ script :

1. Run an external python script (located on the gateway host machine filesystem).
2. Considering this script process some calculatory functions based on Scipy/ Pandas / NumPy, it then return back its output (let’s say a float) into a variable of the ignition gateway Jython script.

Any idea if this can be worked out ?

Thanks.  
Emilien

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 8, 2020, 12:17pm UTC](https://forum.inductiveautomation.com/t/communication-between-gateway-jython-script-and-external-python-script/31139/2 "2020-01-08T12:17:10Z")

</div>

Yes, you can use [java](https://docs.oracle.com/javase/8/docs/api/java/lang/Process.html) or [jython](https://docs.python.org/2/library/subprocess.html) subprocess functions to run the external script, controlling its standard input and capturing its standard output.

---

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [January 8, 2020, 12:18pm UTC](https://forum.inductiveautomation.com/t/communication-between-gateway-jython-script-and-external-python-script/31139/3 "2020-01-08T12:18:41Z")

</div>

It is possible to integrate with ignition server and python application on ignition server or other server thru sockets . We do have a module for that. Webdev allows communication thru a browser and server . What data do you want to exchange between the two applications and at what interval ? It all depends upon that .
