I envy newbies

Tim Peters tim_one at email.msn.com
Sat Jul 17 14:30:33 EDT 1999


[Ivan, clinging to an illicit affair with autoexec.bat]

I'm not arguing about this anymore -- it's too easy <wink>.

If you're going to tell people to edit the file, just be sure to cover all
the problems they can face.  Here's one you're not expecting <wink>:
autoexec.bat may not exist!  Win9*/NT don't need it, and not all
installations have one.

I think the best advice you can give a newbie regardless is to force the
install to put Python in a directory *they* choose, and one without spaces
in its name.  Like C:\Python.  This is easier than telling them how to find
python.exe in the (ill-defined) "default" location, and will simplify later
tasks whether or not they muck with autoexec.bat.

> Usually, these things modify the path by simply adding a line like this:
>
> 	PATH=L:\BC5\BIN;%PATH%

That's cute:  they rely on a bug in the PATH cmd <wink>?  The "=" should be
a blank, or "set " should preface this, although as given it works by
accident.

> which does get around the simple line length limitation.  The actual
> length of the path variable in the environment seems to not suffer the
> 255 character limits that W3.1 had; I was pushing or exceeding that
> limit with 3.1, but I have no such problems now.

Then, Windows being the model of consistency that it is, I'm sure nobody
else could possibly have a problem with this anymore either <wink>.

> ...
> If newbies are *ever* going to use Python, the path has to be correct.

I've lived happily for years without it on my path.  There's also a DOS-free
alternative for newbies:  they can start Python via Start->Run, typing
"python whatever.py" or plain "python" into the dialog.  python.exe doesn't
need to be on the PATH for that to work (unlike a DOS box, Start->Run also
looks in the registry under

    HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\

and the Python installer does register the full path to python.exe there).
MS seemed to be on to a good idea here, but shipped before it was finished.

> ...
> I shall.  I've got a new system that I can afford to mess up.
>
> Does or does not Win32All modify your path?

I certainly hope not <wink>.

[understandable whining about other Windows install programs]
> ...
> Hacking the autoexec.bat is safer than dumping DLLs into the system32
> directory.

It depends, of course.  Apps written for Win95 (or beyond) can also use the
App Paths registry subtree (see above) to fiddle the PATH to be anything it
wants each time the app is started.  This doesn't have to be done in
autoexec.bat anymore, and indeed *shouldn't* be done there.  Apps
overwriting shared DLLs in the System directory are simply braindead, or
haven't been dusted off since their pre-95 versions.

> Have you tried installing AOL4.0 by downloading it recently?

Not recently -- not ever <wink>.

> Not only does it overwrite all your TCP/IP DLLs with old gunk
> that f**ks every other form of networking you've got, but IT WON'T
> BELIEVE THAT IT HAS ALREADY SCREWED YOU UP, so it keeps on trying to
> re-copy the bad DLLs to your system32 directory every time you re-boot.

Things that can cause this include a rogue program in your Programs->Startup
group, or a WININIT.INI file (on Win95) somewhere on your boot drive.  You
should whine at AOL, though -- they presumably wrote their install program.

> Honestly, I can't tell them, "cd to your Python directory for every
> exercise in this book."  I'd rather tell my readers to edit their
> autoexec.bat than tell them how to cd to a directory with spaces in the
> path.  Bleaugh;-(>

As at the start, tell them to install into a directory that's easy to get
at.  You're presumably going to have to tell them how to bring up a DOS box
too.  Then they're going to have a DOS box icon on their desktop, right?
Right-click that icon, select Properties, select the Program tab, enter the
name of the Python directory into the "Working" line, click OK.  Voila.
Their DOS box icon will now start a DOS box already cd'd to the Python
directory, and autoexec.bat hasn't been touched.  Easier than editing a
file, and they can't hurt anything no matter how badly they screw up this
step.

although-later-they-can-easily-delete-their-python-directory-by-
    mistake<wink>-ly y'rs  - tim






More information about the Python-list mailing list