From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ken Mankoff Subject: Re: noweb and :var statements Date: Sun, 06 Oct 2019 22:08:02 +0200 Message-ID: <87ftk5fxi5.fsf@gmail.com> References: <87k19hg7g1.fsf@gmail.com> <87k19hirz7.fsf@gmail.com> <87imp1irdr.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:32968) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iHCp5-0007TL-Hx for emacs-orgmode@gnu.org; Sun, 06 Oct 2019 16:08:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iHCp4-0005A2-Hd for emacs-orgmode@gnu.org; Sun, 06 Oct 2019 16:08:07 -0400 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]:34265) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iHCp4-00059e-AO for emacs-orgmode@gnu.org; Sun, 06 Oct 2019 16:08:06 -0400 Received: by mail-lf1-x134.google.com with SMTP id r22so7802021lfm.1 for ; Sun, 06 Oct 2019 13:08:05 -0700 (PDT) In-reply-to: <87imp1irdr.fsf@gmail.com> 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" To: sebastian.miele@gmail.com Cc: emacs-orgmode@gnu.org On 2019-10-06 at 21:52 +02, Sebastian Miele wrote... > I wrote: > >> [..] >> >> However, something like the following may suit your use case. (For the >> header-args property see section 15.2 (Using Header Arguments) of the >> manual.) >> >> * A Heading >> :PROPERTIES: >> :header-args: :var table=table_foo >> :END: >> >> #+NAME: table_foo >> | foo | >> |-----| >> | 42 | >> | 100 | >> >> #+NAME: import >> #+BEGIN_SRC python >> import numpy as np >> table = np.array(table).astype(np.float).flatten() >> #+END_SRC >> >> #+BEGIN_SRC python :noweb yes :tangle import_noweb.py >> <> >> #+END_SRC > > Just the following works too, of course: > > #+NAME: table_foo > | foo | > |-----| > | 42 | > | 100 | > > #+NAME: import > #+BEGIN_SRC python > import numpy as np > table = np.array(table).astype(np.float).flatten() > #+END_SRC > > #+BEGIN_SRC python :noweb yes :var table=table_foo :tangle import_noweb.py > <> > #+END_SRC The result of tangling this is "import_noweb.py" contains: import numpy as np table = np.array(table).astype(np.float).flatten() And I'd like it to somewhere include the line: table = [42,100] or something similar. I don't have the table data in the tangled code. -k.