am using a python scripts in c/c++ program and i want to import python packages from a zip file as in Sublime Text, is there a better way to do it?

有帮助吗?

解决方案

Use zipimport.

>>> import sys
>>> sys.path.insert(0, 'example.zip')  # Add .zip file to front of path
>>> import foobar
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top