[Tutor] command prompt HOWTO (long)

Cynic cynic@mail.cz
Tue, 05 Jun 2001 06:15:03 +0200


At 20:18 4.6. 2001 -0700, Stephen L Arnold wrote:
>Howdy:
>
>Judging from the lone response I got, I guess I've been expunged
>from the list, consigned to the bit-bucket, redirected to /dev/null
>8-o
>
>Here it is, but it needs some work (some of the longer lines may
>get wrapped in transit).  I'm open to suggestions...
>
>Python Command Prompt mini-HOWTO

I think you should be more to the point -- strip anything not related
to python, namely stuff like this:

>Line 1: @C:\UTILS\NAV\NAVDX.EXE /Startup
>
>This line is for Norton Antivirus for Win95. If you don't have it,
>don't worry (but you should probably have some form of virus
>protection).

If I were looking for a quick guide to setting up my machine for Python,
and found a 14kB of stuff largely OT, I wouldn't be very happy.

<rant>

Well, hmm, I'd call this anything but _mini_-HOWTO. I think it's
actually pretty much of a _maxi_-HOWTO considering you're tutoring
people not how to _program_ (be it in Python or any other lingo), but
basic usage of their oh-so-friendly windows (linux) computers. As it is,
it should be called windows-and-linux-for-dummies-HOWTO

I don't want to sound sarcastic or something, but you could have
save yourself some time if you made it a true mini-HOWTO saying
"Read your Windows User's Manual" or "type 'man bash' (without
quotes)". :)

Or, if you prefer this longer version (windoze only):

"""If you had associated .py files with python.exe, and, upon double-
clicking foo.py file, a dos window (well, it's not a dos window, it's
a 32-bit console window) flashes on your screen, and disappears, your
options are:

win9x: create a batch invoking the foo.py program, and uncheck the "close
when finished" checkbox on the "program" card in its properties.

both win9x and NT: create a batch invoking another cmd instance with /k
switch, that will invoke your foo.py

both win9x and NT: start an instance of shell, and invoke foo.py from
there.
"""

using batches is the approach Perl has taken with it's standard programs,
and has the advantage that you can type just the name of the program
(sans extension), and have it executed. I seem to recall reading somewhere
in Perl's doc-set that it also has a disadvantage -- something about
command.com/cmd.exe being dumb enough about passing arguments, but dunno
what exactly it was.

I've only skimmed the Linux part, but it looked similar to the windows half.

Oh, BTW, I found a terrific set of win32 ports of common unix commands,
which, among others, contains which. :)) http://unxutils.sourceforge.net/

</rant>

an idea, maybe stupid:
what about a wrapper which would take care of the cmd x command /k
invokation? something you could import into your script, something that
would require one or two lines of code per use?
would this be possible with python?



cynic@mail.cz
-------------
And the eyes of them both were opened and they saw that their files
were world readable and writable, so they chmoded 600 their files.
     - Book of Installation chapt 3 sec 7