Just Getting Started with Python on MS XP Pro
rzed
rzantow at gmail.com
Sat Jan 6 11:34:01 EST 2007
DouhetSukd at gmail.com wrote in
news:1168064599.558820.9410 at 42g2000cwt.googlegroups.com:
> Wise choice + welcome to the club.
Seconded.
> The only real XP drawback is that Python is not bundled on
> Windows, while it is included with OS X and most (all?) Linux
> distros.
>
My computer does, in fact, include a Python 2.2.1 installation,
which the manufacturer uses internally.
> 2. use any ol' text editor that _you_ are familiar with, save
> to file, and python <file> under DOS. later on you can always
> pick an editor. i prefer eclipse + pydev, yes, even on windows.
>
> personally, i find pythonwin _great_ to test out code
> interactively, mediocre to write lots of code with and
> occasionally handy to debug code in.
>
> if you hate typing python <file> under DOS, then I guess you
> will have to run programs from pythonwin.
>
Not so, but it takes a little setup. If I want to run a Python
program named, say, "fixthis.py", I can invoke it by typing
"fixthis.py" at the command-line prompt (if I'm running cmd.exe),
or by clicking the icon in Windows Explorer. To make the command-
line option work, I have to have file associations set so that .py
files open with python (and .pyw files open with pythonw, for that
matter). I *think* this is done at install time, though I may have
done that separately.
There is also an environment variable called "pathext", which is
just a list of extensions the system recognizes as being
executable in some way. if you add .py and .pyw to that list, then
all you have to type at the command line is "fixthis" to get that
Python program to run.
I note that I have had my Python root and Python/Scripts directory
on my path at times. There may be some packages that require these
things, but what I talked about in the previous two paragraphs
doesn't require pythonpath to be set specially.
(Fiddling around) Ah! If you want to invoke the interactive python
shell, you will probably want to add the root location to your
path, so you can type
> python
... to invoke it, rather than
> c:\python25\python
... and something similar may be true for the Scripts
subdirectory.
--
rzed
More information about the Python-list
mailing list