Re: Distributing Python environment

2009-09-14 Thread Gabriel Genellina
En Sun, 13 Sep 2009 08:32:33 -0300, Ecir Hana ecir.h...@gmail.com  
escribió:



I have an app which I would like to extend with Python. I I saw how to
embed the interpreter into C. If I bundle my app with the Python lib
(say, python26.dll) I can PyRun_SimpleString() some code. My question
is, how do I bundle the rest of the libraries (site, os, elementtree,
random, ...)? Is it possible to make one huge (ok, not so huge) .zip
blob containing all of the libraries?


Yes. That's what py2exe, cx_freeze and others do.
If you put a .zip file name in sys.path, it is searched as it were a  
directory.



And what happens if some user
has Python already installed? Which libraries get loaded first? Is it
possible to alter this order? I mean, first check for local Python
install and if the user doesn't have Python installation use the
bundled one?


Nothing special. Python looks for modules along its search path  
(sys.path); whatever is found first, wins.


--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list


Re: Distributing Python environment

2009-09-14 Thread Ecir Hana
I see, thanks a lot!
-- 
http://mail.python.org/mailman/listinfo/python-list


Distributing Python environment

2009-09-13 Thread Ecir Hana
Hello,
I have an app which I would like to extend with Python. I I saw how to
embed the interpreter into C. If I bundle my app with the Python lib
(say, python26.dll) I can PyRun_SimpleString() some code. My question
is, how do I bundle the rest of the libraries (site, os, elementtree,
random, ...)? Is it possible to make one huge (ok, not so huge) .zip
blob containing all of the libraries? And what happens if some user
has Python already installed? Which libraries get loaded first? Is it
possible to alter this order? I mean, first check for local Python
install and if the user doesn't have Python installation use the
bundled one?
-- 
http://mail.python.org/mailman/listinfo/python-list