# Call custom method

**URL:** <https://forum.inductiveautomation.com/t/call-custom-method/43649>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [February 20, 2021, 8:50am UTC](https://forum.inductiveautomation.com/t/call-custom-method/43649 "2021-02-20T08:50:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jiawei.liu](https://avatars.discourse-cdn.com/v4/letter/j/bb73d2/32.png) [@jiawei.liu](https://forum.inductiveautomation.com/u/jiawei.liu)\
**Post date:** [February 20, 2021, 8:50am UTC](https://forum.inductiveautomation.com/t/call-custom-method/43649/1 "2021-02-20T08:50:42Z")

</div>

Can I use the library of custom modules in python script?  
if it is possible, can provide me an example

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [February 20, 2021, 11:36am UTC](https://forum.inductiveautomation.com/t/call-custom-method/43649/2 "2021-02-20T11:36:13Z")

</div>

> [@Python, Jython, CPython, Libraries, Pip, and Python 2.7 vs 3 - A quick primer](http://forum.inductiveautomation.com/t/python-jython-cpython-libraries-pip-and-python-2-7-vs-3-a-quick-primer/43201):
>
> We wrote up a Knowledge Base article a little while back that I wanted to post here. It goes over a variety of questions that are common with regard to Python in Ignition. If you’re looking for information on the topic, take a glance at the linked article.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [February 20, 2021, 11:59am UTC](https://forum.inductiveautomation.com/t/call-custom-method/43649/3 "2021-02-20T11:59:16Z")

</div>

Be sure to read the article Nick mentioned first.

> [@Procedure for installing python libraries from source](http://forum.inductiveautomation.com/t/procedure-for-installing-python-libraries-from-source/26022/2):
>
> There’s actually a procedure you can use to use pip from within Jython to install packages, then link Ignition’s Jython lib to an-off-the-shelf Jython lib and use that…however, the article specifically calls out the twilio module as not working, because one of its dependencies, cffi, has C dependencies (IE, won’t work in Jython). For posterity, here’s the procedure, copied verbatim from an internal document: 0) On the server, install Java 8 if you haven’t already. Download the full Jython 2.…

---

<div class="post-metadata">

**Author:** ![jiawei.liu](https://avatars.discourse-cdn.com/v4/letter/j/bb73d2/32.png) [@jiawei.liu](https://forum.inductiveautomation.com/u/jiawei.liu)\
**Post date:** [February 20, 2021, 1:26pm UTC](https://forum.inductiveautomation.com/t/call-custom-method/43649/4 "2021-02-20T13:26:29Z")

</div>

Do I have to put the library in pylib to use it？ because the library I need to use is stored in the custom module file.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [February 20, 2021, 2:45pm UTC](https://forum.inductiveautomation.com/t/call-custom-method/43649/5 "2021-02-20T14:45:23Z")

</div>

Perhaps more information is needed. If you’re talking about modules built through the SDK, then examples are provided on IA’s github site.

> **[inductiveautomation/ignition-sdk-examples](https://github.com/inductiveautomation/ignition-sdk-examples)**
>
> Ignition SDK Example Projects. Contribute to inductiveautomation/ignition-sdk-examples development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![jiawei.liu](https://avatars.discourse-cdn.com/v4/letter/j/bb73d2/32.png) [@jiawei.liu](https://forum.inductiveautomation.com/u/jiawei.liu)\
**Post date:** [February 22, 2021, 3:36am UTC](https://forum.inductiveautomation.com/t/call-custom-method/43649/6 "2021-02-22T03:36:42Z")

</div>

OK,  
Thanks for getting back to me.

---

<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:** [February 22, 2021, 1:23pm UTC](https://forum.inductiveautomation.com/t/call-custom-method/43649/7 "2021-02-22T13:23:51Z")

</div>

Custom modules should expose the java that they want to be callable from jython via the module hook’s `initializeScriptManager()` method. In the gateway, it will be called multiple times on startup (for each project) and thereafter on project updates.
