emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Passing variables between code blocks


From: Yotam Avital
Subject: [O] Passing variables between code blocks
Date: Thu, 24 Jan 2013 12:01:51 +0200

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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]