Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Distributing Python environment

Reply
Thread Tools

Distributing Python environment

 
 
Ecir Hana
Guest
Posts: n/a
 
      09-13-2009
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?
 
Reply With Quote
 
 
 
 
Gabriel Genellina
Guest
Posts: n/a
 
      09-14-2009
En Sun, 13 Sep 2009 08:32:33 -0300, Ecir Hana <(E-Mail Removed)>
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

 
Reply With Quote
 
 
 
 
Ecir Hana
Guest
Posts: n/a
 
      09-14-2009
I see, thanks a lot!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
distributing executable embedding Python nico Python 1 06-30-2004 11:56 PM
Distributing a Python App Allan Hughes Python 3 05-04-2004 06:59 AM
Distributing a Python based application on Linux Ramki Python 2 04-08-2004 04:46 PM
Distributing Python programs NEWS Python 5 01-29-2004 09:28 AM
distributing a standalone python app. under Linux Alexander Eisenhuth Python 2 09-16-2003 08:54 AM



Advertisments