how can i make a executable program with a python2's script

Michael Stenner mstenner at phy.duke.edu
Thu Sep 12 09:32:21 EDT 2002


On Wed, Sep 11, 2002 at 07:29:00PM -0700, jgm2163 wrote:
> Michael Stenner <mstenner at phy.duke.edu> wrote in message news:<mailman.1031351050.14744.python-list at python.org>...
> > On Fri, Sep 06, 2002 at 04:57:19PM -0500, Stephen Boulet wrote:
> > > You can put
> > > 
> > >     #/usr/bin/env python
> > > 
> > > at the top of the file and do a chmod +x file. Is this the answer to the 
> > > right question?
> > 
> > Although since you're trying to use python 2.2.1 on a RHL 7.2 box, you
> > may need to make that
> > 
> >  #!/usr/bin/env python2
> > 
> > Otherwise, you'll get python 1.5.2, which can lead to confusing errors.
> > 
> > 					-Michael
> > > jgm2163 wrote:
> > > > os     :RedHat 7.2
> > > > Python :Python2.2.1
> > > > 
> > > > now,i had writen a python's script (extend with .py)
> > > > how can i make a executable program on RedHat 7.2?
>
> sorry,i want to make a release program on the computer that donot
> install python2.1 (because that python1.5 was installed on the redhat
> 7.2 defaultly).

Well, the most practical way is to just go ahead and install the
python2 package under RHL 7.2 (have your program "Require" it in its
rpm).  

If that's not feasible for you, then probably the easiest thing is to
backport your program to 1.5.2.

After that, the next easiest (and basically only other) thing you can
do is to include python 2.1 (or later) in your program.  I don't know
of any tricky ways to do that.  You would just have to include python
and all of it's files (or all the ones YOU use anyway) in your
program's rpm in such a way that they don't conflict with any other
programs/rpms.  Realistically, this is just silly.  Your admin should
probably be willing to install python2.

					-Michael
-- 
  Michael Stenner                       Office Phone: 919-660-2513
  Duke University, Dept. of Physics       mstenner at phy.duke.edu
  Box 90305, Durham N.C. 27708-0305




More information about the Python-list mailing list