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


Groups > comp.lang.python > #52415

Re: Am I not seeing the Error?

Date 2013-08-12 10:01 -0400
From Ned Batchelder <ned@nedbatchelder.com>
Subject Re: Am I not seeing the Error?
References <5206F4AB.8050204@Gmail.com> <mailman.452.1376188442.1251.python-list@python.org> <roy-4A9C13.22431010082013@news.panix.com> <CAPTjJmoA+r3ABByjgMNC-23H0tB95r6S+d04T-KF-3xgbCNSOQ@mail.gmail.com> <5208D625.2000103@Gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.499.1376316118.1251.python-list@python.org> (permalink)

Show all headers | View raw


On 8/12/13 8:33 AM, Devyn Collier Johnson wrote:
>
> On 08/10/2013 10:47 PM, Chris Angelico wrote:
>> On Sun, Aug 11, 2013 at 3:43 AM, Roy Smith <roy@panix.com> wrote:
>>> In article <mailman.452.1376188442.1251.python-list@python.org>,
>>>   Chris Angelico <rosuav@gmail.com> wrote:
>>>
>>>> When you get a syntax error you can't understand, look at the previous
>>>> line of code. Perhaps something there is incomplete; maybe you have
>>>> mismatched parentheses, so this line is considered to be part of the
>>>> same expression.
>>>>
>>>> Next thing to do is split it into more lines. Why is all that in a 
>>>> single
>>>> line?
>>> Also, try reformatting the code in a tool like emacs or eclipse which
>>> does syntax coloring and auto indenting.  Often, if you're missing some
>>> piece of punctuation, it will become obvious when your tool tries to
>>> indent things in some unexpected way.  Or suddenly starts coloring all
>>> of your program text as if it were a string literal :-)
>> Agreed. Though I've had some odd issues with SciTE in that way; I
>> think its Python handling may have bugs in it here and there. But 95%
>> of the time it's helpful.
>>
>> ChrisA
>
> Thanks everyone. Unfortunately, I have not found the problem yet. I 
> use the Geany IDE which has syntax highlighting, but nothing wrong is 
> seen. None of the suggestions helped. The lines before this one set 
> variables. The lines further up "appear" fine. I will keep looking. If 
> I ever figure it out, I will share with all of you.
>
As Terry Reedy pointed out, you have semicolons separating arguments in 
a function call.  This is your line of code:

JOB_WRITEURGFILES = 
multiprocessing.Process(write2file('./mem/ENGINE_PID', ENGINEPID); 
write2file(SENTEMPPATH, ''); write2file(INPUTMEM, '')); 
JOB_WRITEURGFILES.start()

Replacing names with shorter ones to see the structure, it's like this:

J = m.P( w('', E); w(S, ''); w(I, '') ); J.s()

You have three semicolons in that line.  Two are inside a call, though 
I'm not sure that's what you intended.  One is separating statements.  
You might be a little too attached to your "more readable" style.  
Putting things on different lines really does help you see what is going on.

--Ned.

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


Thread

Re: Am I not seeing the Error? Chris Angelico <rosuav@gmail.com> - 2013-08-11 03:33 +0100
  Re: Am I not seeing the Error? Roy Smith <roy@panix.com> - 2013-08-10 22:43 -0400
    Re: Am I not seeing the Error? Chris Angelico <rosuav@gmail.com> - 2013-08-11 03:47 +0100
    Re: Am I not seeing the Error? Devyn Collier Johnson <devyncjohnson@gmail.com> - 2013-08-12 08:33 -0400
    Re: Am I not seeing the Error? Zachary Ware <zachary.ware+pylist@gmail.com> - 2013-08-12 08:20 -0500
    Re: Am I not seeing the Error? Ned Batchelder <ned@nedbatchelder.com> - 2013-08-12 10:01 -0400
    Re: Am I not seeing the Error? Devyn Collier Johnson <devyncjohnson@gmail.com> - 2013-08-12 10:04 -0400
      Re: Am I not seeing the Error? Roy Smith <roy@panix.com> - 2013-08-12 11:47 -0400
        Re: Am I not seeing the Error? Joel Goldstick <joel.goldstick@gmail.com> - 2013-08-12 12:56 -0400
        Re: Am I not seeing the Error? Chris Angelico <rosuav@gmail.com> - 2013-08-12 18:19 +0100
        Re: Am I not seeing the Error? Devyn Collier Johnson <devyncjohnson@gmail.com> - 2013-08-12 16:16 -0400
        Re: Am I not seeing the Error? Joel Goldstick <joel.goldstick@gmail.com> - 2013-08-12 16:34 -0400
        Re: Am I not seeing the Error? Ned Batchelder <ned@nedbatchelder.com> - 2013-08-12 16:35 -0400
        Re: Am I not seeing the Error? Joshua Landau <joshua@landau.ws> - 2013-08-13 09:19 +0100
          Re: Am I not seeing the Error? Steven D'Aprano <steve@pearwood.info> - 2013-08-13 08:50 +0000
            Re: Am I not seeing the Error? Devyn Collier Johnson <devyncjohnson@gmail.com> - 2013-08-13 06:31 -0400
            Re: Am I not seeing the Error? Robert Kern <robert.kern@gmail.com> - 2013-08-13 13:11 +0100
            Re: Am I not seeing the Error? Terry Reedy <tjreedy@udel.edu> - 2013-08-13 12:12 -0400
            Re: Am I not seeing the Error? Michael Torrie <torriem@gmail.com> - 2013-08-13 19:55 -0600
          Re: Am I not seeing the Error? Grant Edwards <invalid@invalid.invalid> - 2013-08-13 13:55 +0000
    Re: Am I not seeing the Error? Zachary Ware <zachary.ware+pylist@gmail.com> - 2013-08-12 10:37 -0500
    Re: Am I not seeing the Error? Zachary Ware <zachary.ware+pylist@gmail.com> - 2013-08-12 10:47 -0500
  Re: Am I not seeing the Error? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-08-11 08:28 +0000
    Re: Am I not seeing the Error? Joshua Landau <joshua@landau.ws> - 2013-08-11 11:18 +0100
    Re: Am I not seeing the Error? Roy Smith <roy@panix.com> - 2013-08-11 09:27 -0400

csiph-web