Let's take this simple Org code, with two Python code blocs (one which returns a list, and the other one which prints the type and the content of the parameter):
#+NAME: int
#+BEGIN_SRC python :results value
return [1, 2, 3]
#+END_SRC
#+NAME: print_table_info
#+BEGIN_SRC python :var table=[]
print "type = {}".format(type(table))
print "table = {}".format(table)
#+END_SRC
#+CALL: print_table_info(table=int) :results output
Executing the #+CALL:
will produce the expected result:
#+RESULTS:
: type = <type 'list'>
: table = [1, 2, 3]
Now let's assume I want to execute this directly in emacs-lisp with org-sbe
. I would have:
#+BEGIN_SRC emacs-lisp :results output
(org-sbe print_table_info ":results output" (table (org-sbe int)))
#+END_SRC
And executing this code block would produce:
#+RESULTS:
:
: (results (quote (1 2 3)))
:
: (results (type = <type 'str'>
: table = (1 2 3)
: "))
Two issues here, which are related:
- This result shows that a list was not given to the
print_table_info
code block but instead a string. How can I actually pass a list? - How could I get rid from the Lisp code in the output of
org-sbe
and just get the plain output as when I execute the#+CALL:
?
Thanks for your help!