Home/Support/Support Forum/Add additional module to python.zip
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Add additional module to python.zip

0 votes
I am using a ConnectPort X4 gateway and programming with python.
To my disappointment, the python environment in X4 are lack of some useful module for me, such as httplib and json. Can I add these standard module to python.zip? How to do it?

I came up with an idea that I can download the source code of httplib, then compile it with Python 2.4 and put the compiled version into python.zip. Maybe it will work. However, httplib depends on many other library and perhaps I have to clean up the original code to make it work on the embedded python environment of X4 but there is a lot of work to get it done.

Is there any other effective way to do the job?
asked Mar 20, 2014 in 3rd Party Python and API development in other Languages by zdyang New to the Community (1 point)

Please log in or register to answer this question.

1 Answer

0 votes
You can do that, however, rather than modifying python.zip, I would create your pyc files as needed, and put them into your own zip file and then import from that zip. That way if you ever need to update python.zip you don't end up overwriting your code.
answered Mar 20, 2014 by mcarver Community Contributor (108 points)