[Python-Dev] ConfigParser patches

Daniel 'Dang' Griffith pythondev-dang at lazytwinacres.net
Thu Oct 7 01:48:59 CEST 2004

At 11:43 PM 10/2/2004, python-dev-request at python.org wrote:

> Date: Sat, 2 Oct 2004 21:14:07 -0400
> From: "Raymond Hettinger" <python at rcn.com>
> Subject: RE: [Python-Dev] ConfigParser patches
> To: <guido at python.org>
> Cc: python-dev at python.org
> Message-ID: <000801c4a8e6$6217fc20$e841fea9 at oemcomputer>
> Content-Type: text/plain;       charset="us-ascii"
> > I was in fact thinking of the -m proposal when I wrote that...
> The timing does suck.
> > It's so easy to define an alias or use a one-line shell script for
> > invoking Python with a full pathname that I'm really not sure I like
> > the -m idea,
> My understanding was that it wasn't about a full pathname to python, it
> was about searching sys.path for the darned script so us poor Windows
> guys don't have to change directories a million times a day (no aliases
> or shebangs for us either).
> I have a big pile of batch files just to invoke timeit, texchecker,
> profile, etc.  It bites the big one.

Am I missing something?  I run python scripts all the time from the 
command line in Windows.

Modify your PATHEXT environment variable:


Then put your script directory into your PATH:


The first time you run timeit (or whatever.py), Windows will prompt you
to associate the .py extension with a program.  Pick your favorite 
You can also do this manually before running your script.

 From then on, you're set:
    C:\>timeit -s "a=range(20)" "a.append(1)" "a.pop()"
    1000000 loops, best of 3: 1.13 usec per loop

You can put .pyc in your path too, but then you'll get the compiled version
even if the uncompiled version is newer.  But you can always compile them.

More information about the Python-Dev mailing list