From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrea Crotti Subject: [babel] python sessions Date: Sun, 03 Jul 2011 14:18:42 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7BIT Return-path: Received: from eggs.gnu.org ([140.186.70.92]:34193) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdLdN-0007J6-P4 for emacs-orgmode@gnu.org; Sun, 03 Jul 2011 08:18:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QdLdM-0006NJ-SF for emacs-orgmode@gnu.org; Sun, 03 Jul 2011 08:18:45 -0400 Received: from mta-1.ms.rz.rwth-aachen.de ([134.130.7.72]:42348) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdLdM-0006NE-Mu for emacs-orgmode@gnu.org; Sun, 03 Jul 2011 08:18:44 -0400 Received: from ironport-out-1.rz.rwth-aachen.de ([134.130.5.40]) by mta-1.ms.rz.RWTH-Aachen.de (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008)) with ESMTP id <0LNR00D71BJ7IG30@mta-1.ms.rz.RWTH-Aachen.de> for emacs-orgmode@gnu.org; Sun, 03 Jul 2011 14:18:43 +0200 (CEST) Received: from plaetekopp (plaetekopp.informatik.RWTH-Aachen.DE [137.226.59.97]) by relay.rwth-aachen.de (8.14.4+Sun/8.13.8/1) with ESMTP id p63CIg6u011292 for ; Sun, 03 Jul 2011 14:18:42 +0200 (CEST) Received: from crotti by plaetekopp with local (Exim 4.72) (envelope-from ) id 1QdLdK-000710-Rl for emacs-orgmode@gnu.org; Sun, 03 Jul 2011 14:18:42 +0200 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: Org mode I wanted to use sessions in python to do some nice literate programming and splitting functions, but it doesn't work as expected. Here below a very simple example in python and ruby, where in ruby everything seems to work well while in python it doesn't... And by the way, what is that org_babel_python_eoe? I can't find it documented anywhere in the manual... I've read some time ago that python support for babel was a bit tricky, are there workarounds to make it work anyway? Or could you explain briefly what the problem is so that I can try to contribute as soon as I finish this thing? Thanks a lot, Andrea --8<---------------cut here---------------start------------->8--- #+begin_src python :session def var(x): return float(x ** 2) #+end_src #+results: : org_babel_python_eoe #+begin_src python :session def var2(x): return x ** 2 * var(x) var2(10) #+end_src #+results: : org_babel_python_eoe #+begin_src ruby :session def fun(x) x + 2 end #+end_src #+results: : nil #+begin_src ruby :session def fun2(x) x + fun(x) end fun2 10 #+end_src #+results: : 22 --8<---------------cut here---------------end--------------->8---