Use zipimport.
>>> import sys
>>> sys.path.insert(0, 'example.zip') # Add .zip file to front of path
>>> import foobar
Domanda
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?
Soluzione
Use zipimport.
>>> import sys
>>> sys.path.insert(0, 'example.zip') # Add .zip file to front of path
>>> import foobar