Moving to Win XP as a Python developer

Scott David Daniels scott.daniels at acm.org
Fri Oct 14 18:32:49 CEST 2005


Christian Stapfer wrote:
> "John J. Lee" <jjl at pobox.com> wrote in message 
> news:mailman.2039.1129247775.509.python-list at python.org...
> 
>>cmd.exe can be made bearable....
>>
>>0. Make a shortcut to cmd.exe, stick it somewhere get-at-able,
>>  eg. quick launch toolbar
I put it on my desktop.  Once having made it, fiddle with
"Start in" to be your favorite python code directory (that is
why I usually have several), and append a space and /D /X /F:ON
to the "Target" line.

You can see the options to cmd by typing "HELP CMD" or
"HELP CMD>>CMD_DOC", or by looking up the "Windows Command Reference"
and reading about the "cmd" command.

I find a bunch of text in a file easier to read than Microsoft's
help facility (it comes in tiny bites w/o clear navigation to my
tastes).  At one time, more info was in the help command text than
was available through the help facility, but they've gotten closer.
I'm not sure whether the same info is in both; better to review both.

Here's a cute recipe for getting the help command text (works only
for Python 24).
 From Python 2.4 (either in Idle or from a command line):

     import subprocess as subp

     p = subp.Popen("cmd.exe /X/D/F:ON", stdin=subp.PIPE,
                    stdout=subp.PIPE, stderr=subp.STDOUT)
     flag = "(@@@@@@}"
     print >>p.stdin, "PROMPT", flag
     print >>p.stdin, "HELP"
     print >>p.stdin, "EXIT"
     text = p.stdout.read()
     p.wait()
     helptext = text[text.index(flag + 'HELP') + len(flag) + 4 :
                     text.index(flag + 'EXIT')]
     words = [line.split(None, 1)[0]
              for line in helptext.split('\n')
              if line.strip()]
     commands = [word for word in words if word.isupper()]

     dest = open('cmd_help.txt', 'wb')
     p = subp.Popen("cmd.exe /X/D/F:ON", stdin=subp.PIPE,
                    stdout=dest, stderr=subp.STDOUT)
     print >>p.stdin, "PROMPT (@@@@@@@@)"
     print >>p.stdin, "HELP"
     for command in commands:
         print >>p.stdin, "HELP", command
     print >>p.stdin, "EXIT"
     p.wait()
     dest.close()

Also, I found it invaluable to know that typing ALT+SPACE
in the CMD window took me to the options window (good for
pasting).

In moving to work on Windows, you will want a good text editor
(notepad is not enough for me), find an emacs or vim or whatever
and make sure you install it.  I also carry around rcs and a
little utility I wrote called "recent."  It'd be a good idea to
define your own utility directory, stick its name on your command
path and keep stuff in there.  Either MingW32 or VC71 would be good
to have, both might be better.  Good luck.

--Scott David Daniels
scott.daniels at acm.org



More information about the Python-list mailing list