From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dror Atariah Subject: [babel][table] Passing argument to Python code block using org-sbe Date: Fri, 12 Sep 2014 09:26:31 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b5dbb764521ab0502d93499 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSLFa-0005aA-D2 for emacs-orgmode@gnu.org; Fri, 12 Sep 2014 03:26:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XSLFZ-00063U-6M for emacs-orgmode@gnu.org; Fri, 12 Sep 2014 03:26:34 -0400 Received: from mail-pa0-x229.google.com ([2607:f8b0:400e:c03::229]:55542) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSLFY-00063M-Un for emacs-orgmode@gnu.org; Fri, 12 Sep 2014 03:26:33 -0400 Received: by mail-pa0-f41.google.com with SMTP id bj1so641094pad.0 for ; Fri, 12 Sep 2014 00:26:31 -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: "emacs-orgmode@gnu.org" --047d7b5dbb764521ab0502d93499 Content-Type: text/plain; charset=UTF-8 Consider the following code: -------------------------------------------------8<-------------------------------------------------- #+NAME: test #+BEGIN_SRC python :var x="foobar" return len(x) #+END_SRC -------------------------------------------------8<-------------------------------------------------- It is possible to call this, as follows: -------------------------------------------------8<-------------------------------------------------- #+CALL: test(x="fb") -------------------------------------------------8<-------------------------------------------------- However, I fail to call this function and pass an argument to it when using org-sbe: -------------------------------------------------8<-------------------------------------------------- | 6 | #ERROR | #+TBLFM: @1$1='(org-sbe test)::@1$2='(org-sbe test (x ("fb"))) -------------------------------------------------8<-------------------------------------------------- I tried several possibilities, but nothing worked. Is it at all possible? Thanks in advance, Dror PS: I posted also a SE question: http://stackoverflow.com/q/25789183/671013 --047d7b5dbb764521ab0502d93499 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Consider the following code:

-------------------------------------------------8<--------------------= ------------------------------
#+NAME: test
#+BEGIN_SRC= python :var x=3D"foobar"
return len(x)
#+END= _SRC
-------------------------------------------------8<------= --------------------------------------------

I= t is possible to call this, as follows:

----------= ---------------------------------------8<-------------------------------= -------------------
#+CALL: test(x=3D"fb")
-------------------------------------------------8<---------------= -----------------------------------

However, I= fail to call this function and pass an argument to it when using org-sbe:<= /div>
-------------------------------------------------8<-----------= ---------------------------------------
| 6 | #ERROR |
<= div>#+TBLFM: @1$1=3D'(org-sbe test)::@1$2=3D'(org-sbe test (x (&quo= t;fb")))
-------------------------------------------------8&= lt;--------------------------------------------------

I tried several possibilities, but nothing worked. Is it at all pos= sible?

Thanks in advance,
Dror

PS: I posted also a SE question:=C2=A0http://stackoverflow.com/q/25789183/67101= 3
--047d7b5dbb764521ab0502d93499--