[Tutor] Which computer operating system is best for Python developers?
d at davea.name
Thu Feb 23 16:46:40 CET 2012
On 02/23/2012 10:23 AM, Jugurtha Hadjar wrote:
> One last point: Having two versions of Python, here's what I did in
> order to chose which version is used depending what I'm doing (If I'm
> tinkering with Numpy, I must use Python26)
> Python 2.6 is installed in C:\Python26
> Python 3.2 is installed in C:\Python32
> I added both paths to the Windows Environment Variables.
> I created two .bat files named Python26.bat and Python32.bat, each one
> in the respective directory.
> The Python26.bat file contains the follwoing lines:
> @echo off
> C:\Python26\python.exe %1
> And the Python32.bat file contains the follwoing lines:
> @echo off
> C:\Python32\python.exe %1
I'm not running Windows any more (except in a VirtualBox), but your
batch files could be improved:
Since you only have the one useful line in the batch file, just put the
@ on that line; no need to turn off echo for the whole file, when the
file is one line.
And i forget whether it's %* or %$ but there is a substitution
string you can use to mean "all the arguments", rather than just taking
one. Remember that sometimes people want to run python with multiple
I also made a "bat" directory, and added it to the PATH. Then you put
both those batch files, plus some others, into the bat directory. That
assumes you'll keep finding more utilities you'd like to add to the path.
No biggie, just trying to help. There are more complicated changes that
I used to do, which I won't mention here.
More information about the Tutor