emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Python code block hangs with :session if python-mode is loaded


From: Eric Schulte
Subject: Re: [O] Python code block hangs with :session if python-mode is loaded
Date: Sun, 01 Apr 2012 08:50:04 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux)

Richard Stanton <address@hidden> writes:

> I have python-mode (latest version from Launchpad) set up to handle python 
> editing in Emacs.
>
> Using orgmode, the following code block runs fine if Ipress C-c C-c, 
> producing the (correct) output shown:
>
> #+begin_src python :results output
> print "%d + %d = %d" % (2, 3, 2+3)
> 2**5
> #+end_src
>
> #+RESULTS:
> : 2 + 3 = 5
>
> If I do not have (require 'python-mode) in my init.el, the following also 
> works fine:
>
> #+begin_src python :results output :session
> print "%d + %d = %d" % (2, 3, 2+3)
> 2**5
> #+end_src
>
> #+RESULTS:
> : 2 + 3 = 5
> : 32
>
> However, if (require 'python-mode) is in my init.el file, pressing C-c
> C-c in the second code block causes Emacs to hang with the message
> "Executing python code block". I can get out by pressing C-g, but it
> never returns otherwise.
>

Hi Richard,

The above executes without problem for me regardless of whether
python-mode has been explicitly loaded.  I have python mode py-version
"5.1.0" on my machine.  My guess is that python-mode changed the session
prompt in such a way that Babel can not tell when execution has
completed.  I have the following in my *Python* session buffer after
execution [1], what are the contents of your *Python* session buffer
after you have C-g'd out of the loop?

Best,

Footnotes: 
[1]  *Python*
>>> print "%d + %d = %d" % (2, 3, 2+3)
2 + 3 = 5
2**5
>>> 
32
>>> 
>>> 
>>> 'org_babel_python_eoe'
>>> 'org_babel_python_eoe'
>>> print "%d + %d = %d" % (2, 3, 2+3)
2 + 3 = 5
>>> 2**5
32
>>> 
>>> 
>>> 
>>> 'org_babel_python_eoe'
'org_babel_python_eoe'
>>> 
-- 
Eric Schulte
http://cs.unm.edu/~eschulte/



reply via email to

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