Question

mark ferguson markferg at gmail.com
Mon Aug 1 08:00:26 EDT 2011


Peter - well caught!

I've been wondering how that line could have arisen when running a script
through the interpreter from the command line! Pasting it into Idle gives
exactly that output. It was the leading $ that threw me, I took it as the
shell prompt. I think that Camilo was actually typing it into Idle as well.

On 1 August 2011 10:14, Peter Otten <__peter__ at web.de> wrote:

> Camilo Andres Roca Duarte wrote:
>
> > My name is Camilo Roca, I'm a student and recently installed the 2.7.2
> > Python version. The problem is that anytime I try to run a script from
> the
> > Python Shell it returns an error message. I am new using python so I am
> > not sure what to do since what I'm typing in the shell is in a
> > BegginersTutorial.
> >
> > $ python myfunctions.py
> > SyntaxError: invalid syntax
>
> You shouldn't type the line
>
> $ python myfunctions.py
>
> into Idle's "Python Shell" window. The $ is the prompt of Unix shells like
> bash. You have to open such a shell and type the command there, without the
> leading $.
>
> If you are on Windows you have to open a "DOS Prompt" or "Command Window".
> You can then set the working directory with
>
> cd some\path
>
> Of course you have to replace some\path with the path where the file
> myfunctions.py is actually stored. Finally you can invoke your script with
>
> python myfunctions.py
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110801/2faff93e/attachment-0001.html>


More information about the Python-list mailing list