From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [babel] python sessions Date: Mon, 04 Jul 2011 11:23:16 -0600 Message-ID: <877h7ynel8.fsf@gmail.com> References: <87r5671jbz.fsf@gmail.com> <87zkkvkzb4.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:35332) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdmtH-0008Le-KZ for emacs-orgmode@gnu.org; Mon, 04 Jul 2011 13:25:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QdmtF-0002mC-P4 for emacs-orgmode@gnu.org; Mon, 04 Jul 2011 13:24:59 -0400 Received: from mail-pz0-f41.google.com ([209.85.210.41]:46148) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdmtF-0002m1-9y for emacs-orgmode@gnu.org; Mon, 04 Jul 2011 13:24:57 -0400 Received: by pzk4 with SMTP id 4so1810437pzk.0 for ; Mon, 04 Jul 2011 10:24:56 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Andrea Crotti Cc: Org mode --=-=-= Content-Type: text/plain Andrea Crotti writes: > Eric Schulte writes: > >> >> From what I hear the situation should improve in Emacs24, as there is a >> ground up re-write which should contain much of the functionality of >> python-mode.el with the Emacs-amenable license of python.el. >> > > Nice to know, I use python-mode.el and emacs24, but I would vote for a > merge :) > >> >> The eoe string will only even appear in session output when there is no >> other result returned by the code block. I've just pushed up a small >> change which should fix this situation. >> >> The eoe will never appear in tangled code as it is part of the >> interactive session evaluation. >> >> Best -- Eric > > I think the last patch created some problems, now it often (but not > always and I can't get why) when I execute the source block, and still I > can't make it work the previous example that I posted... > I don't understand. What do python code blocks often do after application of the new patch? Using this attached minimal emacs configuration [1] I was able to evaluate the code blocks in this simple org-mode file [2] starting Emacs with the following. : emacs -Q -l minimal.el short.org Perhaps your problems are related to use of python-mode.el? Best -- Eric Footnotes: [1] minimal.el --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline; filename=minimal.el Content-Transfer-Encoding: quoted-printable ;; these lines only required until the upcomming Org-mode/Emacs24 sync (load "~/.emacs.d/src/org/lisp/org.el") (load "~/.emacs.d/src/org/lisp/ob-python.el") (org-reload) ;; Configure Babel to support all languages included in the manuscript (org-babel-do-load-languages 'org-babel-load-languages '((emacs-lisp . t) (python . t) (sh . t))) (setq org-confirm-babel-evaluate nil) --=-=-= Content-Type: text/plain [2] short.org --=-=-= Content-Type: text/x-org Content-Disposition: inline; filename=short.org #+begin_src python :session :results output def var(x): return float(x ** 2) #+end_src #+results: #+begin_src python :session :result value def var2(x): return x ** 2 * var(x) var2(10) #+end_src #+results: : 10000.0 --=-=-= Content-Type: text/plain -- Eric Schulte http://cs.unm.edu/~eschulte/ --=-=-=--