Multiple versions of Python coexisting in the same OS

News123 news1234 at free.fr
Sun Jul 25 16:26:34 EDT 2010


On 07/25/2010 10:18 PM, Thomas Jollans wrote:
> On 07/25/2010 10:04 PM, News123 wrote:
>> sOn 07/25/2010 09:39 PM, Christian Heimes wrote:
>>> Am 25.07.2010 21:32, schrieb Thomas Jollans:
>>>> If a script uses sys.executable instead of "python", there is no
>>>> problem, at all.
>>
>>
>> sys.executable will  not work  with scripts converted with py2exe,
>> as sys.executable will not be the executable of the python interpreter,
>> but with the main executable's name.
> 
> Well, but a script converted with py2exe can't really ever assume that
> there is a Python interpreter, at all.

true :-)


However, why I thought about this is, that
I write sometimes python code, which tries to call other python files.

later on for distribution I use py2exe.

Therefore I use wrapper functions, which will work in either case.

The wrapper could use sys.executable in 'python mode'
and had to call the exe file in 'py2exe mode'




More information about the Python-list mailing list