Why Don't Scripts Run ?

jrc jrchaff at mcn.net
Wed Mar 13 13:37:00 EST 2002


Hi - I'm a reasonably experienced programmer.  I work in
Windows (ME). Thinking to give Python a try, I downloaded
v22 and installed.  At first, it looks good, but then, I discover
it seems impossible to get any scripts to run in the command
prompt, using any available documentation whatever.  I even
have Chris Fehily's book - essentially none of his examples
work with scripts from command prompt; yet this is a 2002
book .  (?!!)

I do have the path set (and yes, rebooted, etc) - I checked it.
It includes both the installation directory and the working
directory.  I started the cmd line prompt using the provided
icon, and also via a Dos Prompt (again, with proper path set),
followed by 'python'.  The interpreter starts up just fine and
works ( >>> 2 + 2  -> 4 , etc).  But, with a script in the
current directory (on the path too), a command,

'python script.py'

completely fails (syntax error).  This is the only way I
know - following the Fehily book and the sparse comments
in Python documentation - to execute scripts from the cmd
line. If v 22 is somehow different, it would be very nice to
point out to (potential) users.  I've also tried every permutation
of this procedure that I can reasonably imagine - with the
same result.

The only way I am able to get scripts to run (without which
python is just a toy) is to use 'Idle', load the file via "File Open",
then in THAT window, execute it, (!!), then back in the cmd
line I have to issue yet another command to get the prompt
back.  This is essentially an unusably awkward procedure,
for my use.  So unless there is some reasonably convenient
way to run scripts, python has no value to me at all.

I would very much appreciate someone telling me which un-
documented point(s) I am missing.  Thanks,

jrc




More information about the Python-list mailing list