You are not logged in.

#1 2009-02-10 08:48:11

Malo
Member
Registered: 2006-12-02
Posts: 43

Use a second instance of Python

Hi.. I hope that what i'll write won't be silly.. I need to run  a program that require a python interpreter with support for unicode UCS4. The python interpreter that is release with archlinux has support for UCS2 instead. I noticed a bug ticket where a user asked to release python recompiled with this support, but a guru aswered him that is not possible.

So, i've got this idea. I compile from source another python interpreter, install it in another path and tell to the app to use this interpreter and not the default..

Is it possible? Anyone could give me any tip?

Thanks

Offline

#2 2009-02-10 15:10:46

tom5760
Member
From: Philadelphia, PA, USA
Registered: 2006-02-05
Posts: 283
Website

Re: Use a second instance of Python

Sure, that should work fine.  One thing you could do, is copy the PKGBUILD for Python using ABS, and rename it to something like
python-ucs4.  All you'd need to add is a "--prefix=" line to the configure script to tell it to install in a different place, run makepkg, and install with pacman.  This way, the files will be tracked by the package manager.

Good luck!

Offline

#3 2009-02-10 15:24:19

Malo
Member
Registered: 2006-12-02
Posts: 43

Re: Use a second instance of Python

Ok.. it's exactly what i'vo done. But how to start the app with this different version of python?

Offline

#4 2009-02-10 15:49:30

BoppreH
Member
Registered: 2009-02-04
Posts: 47

Re: Use a second instance of Python

Malo wrote:

Ok.. it's exactly what i'vo done. But how to start the app with this different version of python?

I think the best way would be using the shebang at the start of the script:

#! /somedir/python-ucs4

Change it to reflect the desired python's directory. This way bash will try to execute the script using the pointed python installation. Hopefully.

Last edited by BoppreH (2009-02-10 15:49:50)

Offline

#5 2009-02-10 18:27:43

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: Use a second instance of Python

Only, doing it that way your programs will not be portable to other systems


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#6 2009-02-10 22:18:10

tom5760
Member
From: Philadelphia, PA, USA
Registered: 2006-02-05
Posts: 283
Website

Re: Use a second instance of Python

Malo wrote:

Ok.. it's exactly what i'vo done. But how to start the app with this different version of python?

You could put the directory containing your python earlier in the PATH environment variable.

i.e.

export PATH=/home/malo/python/bin:$PATH

in your ~/.bashrc or something,

Offline

Board footer

Powered by FluxBB