# Call a python script from the command line

**URL:** <https://forum.inductiveautomation.com/t/call-a-python-script-from-the-command-line/84212>\
**Category:** Ignition\
**Created:** [January 12, 2024, 5:54pm UTC](https://forum.inductiveautomation.com/t/call-a-python-script-from-the-command-line/84212 "2024-01-12T17:54:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![steve\_r](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@steve\_r](https://forum.inductiveautomation.com/u/steve_r)\
**Post date:** [January 12, 2024, 5:54pm UTC](https://forum.inductiveautomation.com/t/call-a-python-script-from-the-command-line/84212/1 "2024-01-12T17:54:51Z")

</div>

Is it possible to create a python script and execute it via the command line as though it was executed in the script console?

For example, I would like to create a script that automatically configures my Sepasoft related information:

```auto
import system

enterprise = system.mes.loadMESObject("New Enterprise", "Enterprise")
enterprise.setName(ENTERPRISE_NAME)
enterprise.setActive(True)
enterprise.save()
...

```

Is there a way to run this script from the ignition command line? Using java and the jython jar directly unsurprisingly fails to import `system`.

```auto
ignition@c245a9a8fd0c:/usr/local/bin/ignition$ /usr/local/bin/ignition/lib/runtime/jre-aarch64/bin/java -Dpython.import.site=false -jar lib/core/common/jython-ia-2.7.2.3.jar setup_equipment.py
Traceback (most recent call last):
  File "setup_equipment.py", line 1, in <module>
    import system
ImportError: No module named system

```

Thanks

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [January 12, 2024, 5:58pm UTC](https://forum.inductiveautomation.com/t/call-a-python-script-from-the-command-line/84212/2 "2024-01-12T17:58:42Z")

</div>

No. Your external system has to call into Ignition (probably via HTTP), such as with the Webdev module.

---

<div class="post-metadata">

**Author:** ![steve\_r](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@steve\_r](https://forum.inductiveautomation.com/u/steve_r)\
**Post date:** [January 12, 2024, 6:08pm UTC](https://forum.inductiveautomation.com/t/call-a-python-script-from-the-command-line/84212/3 "2024-01-12T18:08:10Z")

</div>

That worked and should be sufficient. Thanks for the quick response!
