[Tutor] trouble using 2to3.py

Tim Golden mail at timgolden.me.uk
Tue Nov 3 16:47:05 CET 2009


Richard D. Moores wrote:
> On Tue, Nov 3, 2009 at 05:30, Dave Angel <davea at ieee.org> wrote:
>> (Erasing entire history, since you both top-posted, and it's too confusing)
>>
>> When you run a xxx.py on Windows, it locates the python.exe using the
>> registry entries set up by  assoc and ftype.  But when you run "python" it
>> looks for python.exe (or python.bat, or ...) on the PATH.  So there's not
>> necessarily any conection between your tests.  You're probably running two
>> different versions.
>>
>> Easiest way to know which python is being used is to run it same way:
>>
>> e:\python31\temp> python 2to3.py -w mycalc.py
>>
>> Or the way I do it, have python31.bat and python26.bat, which launch the
>> exact pythons that I want.
> 
> Thanks, Dave. I'm not familiar with .bat files. Could you give me a
> look at one of them?

As an alternative, I've created python26.exe, python31.exe etc. in 
my c:\tools directory (which is on my PATH wherever I am) and which 
are hardlinks to their corresponding c:\python26\python.exe etc.
Same as the batch file, really, only without a batch file!

TJG


More information about the Tutor mailing list