[O] Fwd: run python from org, draft

2013-03-29 Thread Gary Oberbrunner
[sorry, forgot to reply all -- Gary] -- Forwarded message -- From: Gary Oberbrunner ga...@oberbrunner.com Date: Thu, Mar 28, 2013 at 10:43 PM Subject: Re: [O] run python from org, draft To: Andreas Röhler andreas.roeh...@easy-emacs.de Does this assume org-babel-python-mode is

Re: [O] Fwd: run python from org, draft

2013-03-29 Thread Andreas Röhler
Hi Gary, Am 29.03.2013 13:11, schrieb Gary Oberbrunner: Does this assume org-babel-python-mode is set to 'python-mode? The default is 'python, I believe. I don't think you should unconditionally call py-send-string-return-output like that. Also, why would you avoid calling

Re: [O] Fwd: run python from org, draft

2013-03-29 Thread John Hendy
On Fri, Mar 29, 2013 at 9:47 AM, Andreas Röhler andreas.roeh...@easy-emacs.de wrote: Hi Gary, Am 29.03.2013 13:11, schrieb Gary Oberbrunner: Does this assume org-babel-python-mode is set to 'python-mode? The default is 'python, I believe. I don't think you should unconditionally call

Re: [O] Fwd: run python from org, draft

2013-03-29 Thread Eric Schulte
with current GNU Emacs 24.3.1 (i686-pc-linux-gnu, GTK+ Version 2.24.14) of 2013-03-05 Org-mode version 7.9.3f (release_7.9.3f-17-g7524ef @ MY_PATH/emacs-24.3/lisp/org/) python from org-source seems completely broken. For example: #+BEGIN_SRC python 1+2 #+END_SRC #+RESULTS: : None

Re: [O] Fwd: run python from org, draft

2013-03-29 Thread Andreas Röhler
Am 29.03.2013 16:09, schrieb Eric Schulte: with current GNU Emacs 24.3.1 (i686-pc-linux-gnu, GTK+ Version 2.24.14) of 2013-03-05 Org-mode version 7.9.3f (release_7.9.3f-17-g7524ef @ MY_PATH/emacs-24.3/lisp/org/) python from org-source seems completely broken. For example: #+BEGIN_SRC python

Re: [O] Fwd: run python from org, draft

2013-03-29 Thread John Hendy
On Fri, Mar 29, 2013 at 10:09 AM, Eric Schulte schulte.e...@gmail.com wrote: with current GNU Emacs 24.3.1 (i686-pc-linux-gnu, GTK+ Version 2.24.14) of 2013-03-05 Org-mode version 7.9.3f (release_7.9.3f-17-g7524ef @ MY_PATH/emacs-24.3/lisp/org/) python from org-source seems

Re: [O] Fwd: run python from org, draft

2013-03-29 Thread John Hendy
On Fri, Mar 29, 2013 at 10:09 AM, Eric Schulte schulte.e...@gmail.comwrote: with current GNU Emacs 24.3.1 (i686-pc-linux-gnu, GTK+ Version 2.24.14) of 2013-03-05 Org-mode version 7.9.3f (release_7.9.3f-17-g7524ef @ MY_PATH/emacs-24.3/lisp/org/) python from org-source seems

Re: [O] Fwd: run python from org, draft

2013-03-29 Thread Eric Schulte
Andreas Röhler andreas.roeh...@easy-emacs.de writes: Am 29.03.2013 16:09, schrieb Eric Schulte: with current GNU Emacs 24.3.1 (i686-pc-linux-gnu, GTK+ Version 2.24.14) of 2013-03-05 Org-mode version 7.9.3f (release_7.9.3f-17-g7524ef @ MY_PATH/emacs-24.3/lisp/org/) python from org-source

Re: [O] Fwd: run python from org, draft

2013-03-29 Thread Eric Schulte
John Hendy jw.he...@gmail.com writes: On Fri, Mar 29, 2013 at 10:09 AM, Eric Schulte schulte.e...@gmail.comwrote: with current GNU Emacs 24.3.1 (i686-pc-linux-gnu, GTK+ Version 2.24.14) of 2013-03-05 Org-mode version 7.9.3f (release_7.9.3f-17-g7524ef @ MY_PATH/emacs-24.3/lisp/org/)

Re: [O] Fwd: run python from org, draft

2013-03-29 Thread Eric Schulte
As we've proven a couple of times now, Python session are broken with the newest version of Emacs (since the upstream change to an entirely new python.el implementation). I've just pushed up a fix to ob-python.el so that sessions should now work with the latest version of Emacs. I hope this

Re: [O] Fwd: run python from org, draft

2013-03-29 Thread Andreas Röhler
Am 29.03.2013 17:20, schrieb Eric Schulte: A valid opinion, in fact I think I defended that point of view myself, Hi Eric, so, if I'm saying: let's make things considerably easier, working right from the spot, why not try that? What I need still is a specification, what :session and the

Re: [O] Fwd: run python from org, draft

2013-03-29 Thread Eric Schulte
Andreas Röhler andreas.roeh...@easy-emacs.de writes: Am 29.03.2013 17:20, schrieb Eric Schulte: A valid opinion, in fact I think I defended that point of view myself, Hi Eric, so, if I'm saying: let's make things considerably easier, working right from the spot, why not try that? What

Re: [O] Fwd: run python from org, draft

2013-03-29 Thread Evan Misshula
Org-mode version 8.0-pre (release_8.0-pre-203-g993e3e @ /home/evan/Documents/org/elisp/org-mode/lisp/) GNU Emacs 24.3.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.10) of 2013-03-21 on evan-Dell-System-Inspiron-N7110 [2 times] I installed the patched version. It does hold session definition:

Re: [O] Fwd: run python from org, draft

2013-03-29 Thread Eric Schulte
But it does not appear to support named session: Works with a named session. #+begin_src python :session foo x = 9 x #+end_src #+RESULTS: : None #+begin_src python :session foo x #+end_src #+RESULTS: Thanks, Evan Thanks for reporting this, I've just pushed up a fix,

Re: [O] Fwd: run python from org, draft

2013-03-29 Thread Evan Misshula
It works exactly as advertised for me. Many thanks!! On Fri, Mar 29, 2013 at 2:50 PM, Eric Schulte schulte.e...@gmail.comwrote: But it does not appear to support named session: Works with a named session. #+begin_src python :session foo x = 9 x #+end_src #+RESULTS: :

Re: [O] Fwd: run python from org, draft

2013-03-29 Thread Andreas Röhler
Am 29.03.2013 17:47, schrieb Eric Schulte: As we've proven a couple of times now, Python session are broken with the newest version of Emacs (since the upstream change to an entirely new python.el implementation). I've just pushed up a fix to ob-python.el so that sessions should now work with

Re: [O] Fwd: run python from org, draft

2013-03-29 Thread Gary Oberbrunner
On Fri, Mar 29, 2013 at 11:09 AM, Eric Schulte schulte.e...@gmail.comwrote: Because of quirks of the python language, when executing outside of a session, it is necessary to explicitly specify a return. ... This is clearly stated in the Python documentation on Worg.

Re: [O] Fwd: run python from org, draft

2013-03-29 Thread Andreas Röhler
Am 29.03.2013 17:47, schrieb Eric Schulte: As we've proven a couple of times now, Python session are broken with the newest version of Emacs (since the upstream change to an entirely new python.el implementation). I've just pushed up a fix to ob-python.el so that sessions should now work with

Re: [O] Fwd: run python from org, draft

2013-03-29 Thread Andreas Röhler
Am 29.03.2013 20:59, schrieb Gary Oberbrunner: On Fri, Mar 29, 2013 at 11:09 AM, Eric Schulte schulte.e...@gmail.comwrote: Because of quirks of the python language, when executing outside of a session, it is necessary to explicitly specify a return. ... This is clearly stated in the Python

Re: [O] Fwd: run python from org, draft

2013-03-29 Thread Eric Schulte
Gary Oberbrunner ga...@oberbrunner.com writes: On Fri, Mar 29, 2013 at 11:09 AM, Eric Schulte schulte.e...@gmail.comwrote: Because of quirks of the python language, when executing outside of a session, it is necessary to explicitly specify a return. ... This is clearly stated in the

Re: [O] Fwd: run python from org, draft

2013-03-29 Thread Gary Oberbrunner
Thanks, Eric. The -i is definitely needed on Windows, I just retested without it and it hangs. With your latest fix, it works again. I think there's a bug in your patch though; line 211 refers to a nonexistent function org-babel-python-earmufs. I think you mean -with-earmufs? -- Gary

Re: [O] Fwd: run python from org, draft

2013-03-29 Thread Eric Schulte
Gary Oberbrunner ga...@oberbrunner.com writes: Thanks, Eric. The -i is definitely needed on Windows, I just retested without it and it hangs. With your latest fix, it works again. I think there's a bug in your patch though; line 211 refers to a nonexistent function