emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] org-babel -- Improper syntax error in session mode?


From: Jambunathan K
Subject: Re: [O] org-babel -- Improper syntax error in session mode?
Date: Tue, 21 Jun 2011 02:48:18 +0530
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (windows-nt)

Discalimer: I neither use python or babel.

> Eric Schulte <schulte.eric <at> gmail.com> writes:
>> I can confirm that I see the same behavior.  Also, if I manually type
>> the body of the code block into the session I get the same error output
>> from Python, so I don't believe this is due to a problem with Babel.
>> 
>
> It appears the problem is that the python session is interactive and
> is built to emit output after each Python "block" (e.g., the 'for'
> block), before another "block" of Python is entered.

> If this is the way it's designed 

ISTM you are speculating on design based on a very simple example and
just this "specific implementation".

> then it seems to me that it's Babel's obligation to feed the Python
> blocks to the Python session as required and then assemble the output
> pieces as appropriate.  Or am I missing something? -- Herb

There is a difference between feeding an interactive shell by hand and
feeding interactive shell via a program (The latter one is very
fast). The behaviour pertaining to buffering and flusing of output
buffers would not be apparent unless large volumes of output text is
spewed. 

The assumption that is being made in this thread is that:

"Python interpreter blocks until *all* output are *appears at the*
console before moving on to the next block."

While it is reasonable to assume that Python interpreter *flushes the
output buffers" it seems a bit too far-fetched to me to assume that
python interpreter can *guarantee" the appearance of the spewed block
before proceeding to the next block.

Unless python spec clearly and *positively* confirms the behaviour you
are assuming in *all* compliant-implementations, it is generally a good
idea to be conservative and not rely on observed behaviour too much.

Just my 2 cents. 

ps: Ignore if I have poorly understood the items discussed in this
thread.

Jambunathan K..


-- 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]