emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Yotam Avital <yotama9@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Passing variables between code blocks
Date: Thu, 24 Jan 2013 12:01:51 +0200	[thread overview]
Message-ID: <CAAShNtsxJ3J1XQkTKBDUVDcA=Me8RuwZFJMct-yPX8uveQVJKw@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 815 bytes --]

I want to use org-mode for data analysis for my results. I also want to do
this using small chunks of code blocks for various task. To achieve that. I
need to pass dictionaries (20 entries of lists, each of several hundreds
variables, each is a list by itself). I wanted to do so by the #+CALL
option for example:


* test
  #+NAME:test
  #+BEGIN_SRC python
    vars = dict()
    vars[1] = 1
    vars[2] = 2
    return vars

  #+END_SRC

* caller
  #+NAME: caller
  #+HEADER: :var ins=#+CALL: test()
  #+BEGIN_SRC python :results output
    print files

  #+END_SRC

But I get an error:

  File "<stdin>", line 1
    files=[1:, 1, 2:, 2]
            ^
SyntaxError: invalid syntax

Is there a way to pass a dictionary as a variables between blocks then?



-- 
My other email account has a "professional" signature.

[-- Attachment #2: Type: text/html, Size: 1297 bytes --]

             reply	other threads:[~2013-01-24 10:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-24 10:01 Yotam Avital [this message]
2013-01-24 13:38 ` Thomas S. Dye

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAShNtsxJ3J1XQkTKBDUVDcA=Me8RuwZFJMct-yPX8uveQVJKw@mail.gmail.com' \
    --to=yotama9@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: Passing variables between code blocks' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).