Subject: |
RE: How to add required Python module to ZenPack |
Author: |
Jane Curry |
Posted: |
2018-09-06 06:34 |
If it is a a pure Python module that you want to include with your ZenPack, you can include the .egg code in the lib directory of your ZenPack. You then need to amend the __init__.py file in the main directory of your ZenPack, to include:
import os
import sys
libDir = os.path.join(os.path.dirname(__file__), 'lib')
if os.path.isdir(libDir):
sys.path.append(libDir)
for file in os.listdir(libDir):
if file.endswith('.egg'):
sys.path.append(os.path.join(libDir, file))
There is an example in my ZenPacks.community.VMwareESXiMonitorPython on GitHub at
https://github.com/jcurry/ZenPacks.community.VMwareESXiMonitorPython Cheers,
Jane
------------------------------
Jane Curry
Skills 1st United Kingdom
jane.curry@skills-1st.co.uk
------------------------------
Subject: |
RE: How to add required Python module to ZenPack |
Author: |
Bharat Kumar Kobagana |
Posted: |
2018-09-06 23:41 |
Thanks a lot Jane. Will go through your ZenPack.
------------------------------
Bharat Kumar Kobagana
------------------------------