Multiple versions of Python coexisting in the same OS

Edward Diener eldiener at tropicsoft.invalid
Sun Jul 25 17:21:55 EDT 2010


On 7/25/2010 4:26 PM, News123 wrote:
> 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'
>

You can control what you do but how are you going to control what any 
givemn script does ?

Attempting to intrusively change potentially every script in a 
distribution in any way is a path to Python hell IMO.



More information about the Python-list mailing list