473,396 Members | 1,847 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

bundling python with application

I'd like to bundle Python with my app, which will be targeted at Linux,
Windows and Mac. Discussions I've found about this tend to lead to
py2exe, freeze, etc, but I'd like to do something rather simple and am
seeking advice.

What I'd like to do is just copy the standard libraries and
executable(s) and adjust the paths in the environment variables. The
libraries and executable(s) would reside in the same directory with the
application so that you could run the application without needing to
install it. The directory might look like this:

$ ls

start-app.sh
app_lib/
python_lib/
python_bin/
start-app.sh would look like this:

#!/bin/sh

PATH="python_bin:$PATH" PYTHON_HOME="./python_lib" python app_lib/start.py

Of course, there would be a start-app.bat for Windows.

The PATH is altered to make sure the right python interpreter is found
and PYTHON_HOME makes sure the right (local) libraries are found.

Can this be done?

Randall

Jul 27 '08 #1
1 1730
Randall Smith schrieb:
I'd like to bundle Python with my app, which will be targeted at Linux,
Windows and Mac. Discussions I've found about this tend to lead to
py2exe, freeze, etc, but I'd like to do something rather simple and am
seeking advice.

What I'd like to do is just copy the standard libraries and
executable(s) and adjust the paths in the environment variables. The
libraries and executable(s) would reside in the same directory with the
application so that you could run the application without needing to
install it. The directory might look like this:

$ ls

start-app.sh
app_lib/
python_lib/
python_bin/
start-app.sh would look like this:

#!/bin/sh

PATH="python_bin:$PATH" PYTHON_HOME="./python_lib" python app_lib/start.py

Of course, there would be a start-app.bat for Windows.

The PATH is altered to make sure the right python interpreter is found
and PYTHON_HOME makes sure the right (local) libraries are found.

Can this be done?
It might be doable (virtualenv shows it works, you might consider taking
a look into it), but I would advise against it. py2exe and py2app for
example do a great job to provide a way to distribute software in a way
the respective target OS (and their users) are expecting it.

For example, OSX uses so-called "application bundles" which py2app
(guess where the name comes from...) produces for you. Not using them
might cripple you, because e.g. GUI-stuff isn't working properly (or
will show an arbitrary icon in the dock, instead of one you chose).

Why do you insist on re-inventing a wheel that's rolling fine?

Diez
Jul 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Phillip J. Eby | last post by:
PEP: 333 Title: Python Web Server Gateway Interface v1.0 Version: $Revision: 1.1 $ Last-Modified: $Date: 2004/08/27 17:30:09 $ Author: Phillip J. Eby <pje at telecommunity.com> Discussions-To:...
2
by: Roose | last post by:
With some googling I have found these resources: http://docs.python.org/ext/win-dlls.html http://www.python.org/doc/faq/windows.html I have a large Win32/MFC/C/C++ application that has an...
0
by: Robby Dermody | last post by:
Hey guys (thus begins a book of a post :), I'm in the process of writing a commercial VoIP call monitoring and recording application suite in python and pyrex. Basically, this software sits in a...
1
by: Marc | last post by:
Here goes... Outlook 2003 -> Access -> Crystal Reports ...via VB 6.0 code Basically I have a VB 6.0 project working on my machine. All with the click of a button , the Vb code extracts rows...
4
by: opensourcearts | last post by:
Hello all, I am working on an application that is basically a bridge between oscommerce and gallery2 software, with some other functionality. It will allow users to port all of their media...
6
by: Ben Finney | last post by:
Howdy all, I'm improving an existing application that's partly written using Python and the standard library. Many of the improvements I want to make can be done by using third-party free...
2
by: Michael R. Copeland | last post by:
I have some questions about the suitability of Python for some applications I've developed in C/C++. These are 32 bit Console applications, but they make extensive use of STL structures and...
4
by: Benjamin | last post by:
Hello, I'm writing a Python/PyQt application. For my Mac distribution. I would like to include all the needed libraries in the Mac bundle. How should I go about doing this?
1
by: lttan123 | last post by:
Bundling framework in a setup file Hi there, hope someone can help me out in this. i am creating an application to check if .net framework 3.5 is installed. If not installed i will...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.