Computer Hope

Microsoft => Microsoft DOS => Topic started by: belen on May 02, 2011, 08:41:03 AM

Title: python script
Post by: belen on May 02, 2011, 08:41:03 AM
Hi
I don’t know anything about programming languages.  I’m trying to run a python script from the command line (./proc.py) and I get the following message “./proc.py is not recognized as an internal or external command, operable program or batch file.  What should I do?
Title: Re: python script
Post by: Geek-9pm on May 02, 2011, 10:16:16 AM
Hi
I don’t know anything about programming languages.  I’m trying to run a python script from the command line (./proc.py) and I get the following message “./proc.py is not recognized as an internal or external command, operable program or batch file.  What should I do?
The command
./proc.py
will not work from the command line. It is not part of the set or programs or commands that *DOS knows about. A script has to be run from its interpreter.This rule applies not only to Python, but all scripting languages.
A Python interpreter suitable for DOS can be found at:
http://www.python.org/
The current production versions are Python 2.7.1 and Python 3.2.

Once you have a suitable version installed on your PC, you can invoke Python from the command line and pass the script as an argument. See the documentation for examples.
--------
*DOS, I mean the command line  in Windows. Everybody calls it DOS and the documentation is found under DOS on this forum.
Title: Re: python script
Post by: Geek-9pm on May 02, 2011, 11:22:00 AM
Screen Shot of shell.
(http://geek9pm.com/test/python.png)