[Tutor] Just getting started in Python

Ivan Van Laningham ivanlan@callware.com
Thu, 15 Jul 1999 09:15:10 -0600


Hi All--

kjhagen@mmm.com wrote:
> 
> I verified that the interpreter works by doing the following:
> 
> >>> 12*12
> 144
> >>> import string
> >>> string.split ("hello world")
> ['hello', 'world']
> >>>
> 
> This all works fine in both the python shell and command line windows.  I
> start working my way though the "Learning Python" book and when asked to
> run a module file on page 13, I get the following error message at the NT
> command prompt line.
> 
> "The name specified is not recongnized as an internal or external command,
> operable program or batch file"
> 
> I typed my "spam.py" file in as follows, using WordPad.  I saved the file
> "spam.py" as a text file.
> 
> import sys
> print sys.argv
> 
> Why am I not able to get this simple progam to run at the "C:\misc\book"
> prompt in NT4.0?
> 

The short answer is that NT and Windows are stupid.  The slightly longer
answer is that you must, on Win$, type 'python spam.py' and hit return. 
That will get you by until you find time for one of the longer answers.

The much longer answer is that you have to make NT aware of the
association between the .py suffix and the python.exe file, and even
after that you have to jump through some hoops.

Another short answer is to install pythonwin, which will make the file
associations for you.

<yes-we-have-no-long-long-long-answers-today>-ly y'rs,
Ivan
----------------------------------------------
Ivan Van Laningham
Callware Technologies, Inc.
ivanlan@callware.com
ivanlan@home.com
http://www.pauahtun.org
See also: 
http://www.foretec.com/python/workshops/1998-11/proceedings.html
Army Signal Corps:  Cu Chi, Class of '70
----------------------------------------------