[Tutor] I cannot "run" any Python programs

Joel Goldstick joel.goldstick at gmail.com
Thu Feb 23 00:02:23 CET 2012


On Wed, Feb 22, 2012 at 5:49 PM, Tamar Osher <emeraldoffice at hotmail.com> wrote:
> Dear Joel: HI!  Thanks for helping.  When I use the Python shell, and
> navigate to the saved Python program, what happens is:
> A second Python shell pops up, displaying the coding of the program (which
> is a tiny 'hello world' program).  This is what is displayed in the second
> Python shell:
>>>> print("Hello, World!")
>
> In the first Python shell, when I type in what you requested, this is what
> happens:
>>>> python myprogram.py
> SyntaxError: invalid syntax
>>>> python hello.py
> SyntaxError: invalid syntax
>>>>
>
> I am not able to use the Python shell to find the saved Python program.  I
> am able to use Notepad++ to locate the saved Python program, but I cannot
> run the program.  I cannot do anything with the command prompt (black box).
>
> I request help to figure out how to run Python programs. Thanks for helping
> me!
>

from the >>>> stuff at the start of each line, you are in a python
shell.  Don't do that.  Just get into a command shell.
Since I believe you are in windows, press the start button, then run
command and the command you run should be cmd

This will bring you to a window which looks a lot like DOS used to
look.  You probably are too young for that.  Anyway, at that point,
try typing python myprogram.py


-- 
Joel Goldstick


More information about the Tutor mailing list