Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #25230

Re: syntax error message

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python@mrabarnett.plus.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'beginner': 0.05; 'bits': 0.07; 'python': 0.09; '(it': 0.09; 'bits.': 0.09; 'output,': 0.09; 'subject:error': 0.11; '"for"': 0.16; '"or"': 0.16; '"syntax': 0.16; 'error"': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'message- id:@mrabarnett.plus.com': 0.16; 'shell"': 0.16; 'wrote:': 0.17; 'shell': 0.18; 'module': 0.19; 'needed.': 0.23; 'seems': 0.23; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'select': 0.26; 'heading': 0.27; 'went': 0.28; 'run': 0.28; 'clicked': 0.29; 'mode.': 0.29; 'received:192.168.1.3': 0.29; 'words': 0.29; 'folder': 0.30; 'window': 0.30; 'file': 0.32; 'mixed': 0.33; 'to:addr:python-list': 0.33; 'skip:d 20': 0.34; 'changed': 0.34; 'text': 0.34; 'entered': 0.34; 'saved': 0.35; 'open': 0.35; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'help': 0.40; 'your': 0.60; 'red': 0.60; 'john': 0.60; 'remove': 0.61; 'letters': 0.62; 'header:Reply-To:1': 0.68; 'reply-to:no real name:2**0': 0.72; 'click': 0.76; 'cow': 0.84; 'reply- to:addr:python.org': 0.84
X-CM-Score 0.00
X-CNFS-Analysis v=2.0 cv=O927TWBW c=1 sm=1 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=YsUzL_8ObRgA:10 a=ihvODaAuJD4A:10 a=OUOv7kDek9cA:10 a=8nJEP1OIZ-IA:10 a=EBOSESyhAAAA:8 a=8AHkEIZyAAAA:8 a=cFigzXDmeU3EvtZLIN0A:9 a=wPNLvfGTeEIA:10 a=0nF1XD0wxitMEM03M9B4ZQ==:117
X-AUTH mrabarnett:2500
Date Thu, 12 Jul 2012 19:17:33 +0100
From MRAB <python@mrabarnett.plus.com>
User-Agent Mozilla/5.0 (Windows NT 5.1; rv:13.0) Gecko/20120614 Thunderbird/13.0.1
MIME-Version 1.0
To python-list@python.org
Subject Re: syntax error message
References <1342115313.72395.YahooMailRC@web83602.mail.sp1.yahoo.com>
In-Reply-To <1342115313.72395.YahooMailRC@web83602.mail.sp1.yahoo.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
Reply-To python-list@python.org
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2057.1342117060.4697.python-list@python.org> (permalink)
Lines 25
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1342117060 news.xs4all.nl 6888 [2001:888:2000:d::a6]:59122
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:25230

Show key headers only | View raw


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.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: syntax error message MRAB <python@mrabarnett.plus.com> - 2012-07-12 19:17 +0100

csiph-web