Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

syntax error message

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


johnnydemag at sbcglobal

Jul 12, 2012, 10:48 AM

Post #1 of 2 (85 views)
Permalink
syntax error message

Using Python 3.2.3
In shell I made a simple program; dog=2,cat=3,cow=dog+cat
Entered cow and received 5 as answer
Saved-as Trial-1.py in a user folder
Went to folder and select "edit with shell" for that file
Trial-1.py displayed, clicked save, run and then run module to activate program
got message in box "syntax error" and after I clicked OK the #2 in the heading
Python 3.2.3 was high-lighted
 in red and the "or" and "for" words were changed to red letters and program
seems to be text only.
In other words, I am not able to re-use or change the program

Help needed.
John, a beginner


python at mrabarnett

Jul 12, 2012, 11:17 AM

Post #2 of 2 (84 views)
Permalink
Re: syntax error message [In reply to]

On 12/07/2012 18:48, John Magness wrote:
> Using Python 3.2.3
> In shell I made a simple program; dog=2,cat=3,cow=dog+cat
> Entered cow and received 5 as answer
> Saved-as Trial-1.py in a user folder
> Went to folder and select "edit with shell" for that file
> Trial-1.py displayed, clicked save, run and then run module to activate
> program
> got message in box "syntax error" and after I clicked OK the #2 in the
> heading Python 3.2.3 was high-lighted
> in red and the "or" and "for" words were changed to red letters and
> program seems to be text only.
> In other words, I am not able to re-use or change the program
> Help needed.
> John, a beginner
>
You were entering it in interactive mode. When you saved it as
"Trial-1.py" what you actually saved was all of the prompts and the
output, which isn't a valid program (it has lots of other bits mixed in
with it).

If you click File->New Window you will get an empty window into which
you can type your program.

You can just open the file and then edit it to remove the unwanted bits.
--
http://mail.python.org/mailman/listinfo/python-list

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.