From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Schmitt Subject: Re: org-babel pass data between blocks Date: Mon, 28 Apr 2014 15:07:29 +0200 Message-ID: References: <9F2375C3-005C-49EF-8E74-A3B2E5DB713B@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57527) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WelHk-0005v2-TC for emacs-orgmode@gnu.org; Mon, 28 Apr 2014 09:07:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WelHe-00007b-Ox for emacs-orgmode@gnu.org; Mon, 28 Apr 2014 09:07:52 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:13041) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WelHe-00007D-IV for emacs-orgmode@gnu.org; Mon, 28 Apr 2014 09:07:46 -0400 In-Reply-To: <9F2375C3-005C-49EF-8E74-A3B2E5DB713B@gmail.com> (Marvin Doyley's message of "Mon, 28 Apr 2014 08:41:39 -0400") 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: Marvin Doyley Cc: emacs-orgmode@gnu.org On 2014-04-28 14:41, Marvin Doyley writes: > Dear All, > > Is there way to pass data between blocks in org-babel. For example lets say have two blocks > > > #+begin_src python > from pylab import * > # Simple carrier > t=linspace(0,1,100); > fc=100; > Ac =1; > C=Ac*cos(2*pi*t); > > #+end_src > > > What I would like to do is to pass both C and t to another python block, but it is not clear how to do this. > > #+begin_src python > from pylab import * > > fm=1; > Am=1 > m=Am*cos(2*pi*t); # message signal > > z=m*C; #double side-band modulated signal > > #+end_src I see three options (there are probably many others): - use a session (see http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-python.html for instance); - have C and t be the results of the first block, and chain the blocks; - use noweb to include the second block is the first block. Alan