From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id uCvKFeVyUGCwJQAA0tVLHw (envelope-from ) for ; Tue, 16 Mar 2021 08:57:09 +0000 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id MIlnEeVyUGBfdwAAB5/wlQ (envelope-from ) for ; Tue, 16 Mar 2021 08:57:09 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 9F9FA247A7 for ; Tue, 16 Mar 2021 09:57:08 +0100 (CET) Received: from localhost ([::1]:46906 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lM5Vj-0006sX-2A for larch@yhetil.org; Tue, 16 Mar 2021 04:57:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48788) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lM5VE-0006sH-Jy for emacs-orgmode@gnu.org; Tue, 16 Mar 2021 04:56:36 -0400 Received: from outpost1.zedat.fu-berlin.de ([130.133.4.66]:57583) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lM5VC-0008Pj-5Q for emacs-orgmode@gnu.org; Tue, 16 Mar 2021 04:56:36 -0400 Received: from inpost2.zedat.fu-berlin.de ([130.133.4.69]) by outpost.zedat.fu-berlin.de (Exim 4.94) for emacs-orgmode@gnu.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (envelope-from ) id 1lM5Ur-0039DA-5H; Tue, 16 Mar 2021 09:56:13 +0100 Received: from 130-133-144-203.mna.fu-berlin.de ([130.133.144.203] helo=hornfels) by inpost2.zedat.fu-berlin.de (Exim 4.94) for emacs-orgmode@gnu.org with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (envelope-from ) id 1lM5Uq-003yWq-TU; Tue, 16 Mar 2021 09:56:13 +0100 From: "Loris Bennett" To: Org Mode Mailing List Subject: Sharing variables between source blocks without session Date: Tue, 16 Mar 2021 09:56:13 +0100 Message-ID: <87o8fjscia.fsf@hornfels.zedat.fu-berlin.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Original-Sender: loris.bennett@fu-berlin.de X-Originating-IP: 130.133.144.203 Received-SPF: pass client-ip=130.133.4.66; envelope-from=loris@zedat.fu-berlin.de; helo=outpost1.zedat.fu-berlin.de X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1615885028; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=9GqYyVV1m4SVgovXL9Om3ZiuTpWlSPt4blP1lujLyIY=; b=acTF4xSND2AR/uiStXpUvD0yuUWml4IMwsP2giMz7G5/aWhkAQ7x/DARDB13JLA5Ky7eKg 4l1zfA/IoN3NpX3U6gV2AhLtHgwx1uMxdg4G26SSxN/sFZ/us2IJiUl8z29PThN+OzrTgW +ow1fP8MDdK0Z8FcbdD1FW9h6hCsZf/5gkyCwsMpF2uvzI+RQkz9ULKtEijxTdkFXZcA40 /APvoGMYJYEb1JVdc1rRG5VF7WCZlk12XxGZLRCSyWd3hVj85XJ6m/hi2f5pJkJICc5uQm CFFKaUEwdbC+Vt8MWvArglGfj/nDhm2eFChduunroheRRpLKrOrnxblm6EFeJg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1615885028; a=rsa-sha256; cv=none; b=UzBf5CVIUhmWKmGe5gahMucFd6DU3bNvHbBz/nh2VLFwDxYWwCmmcJ9FxJllPul4dq34Nz Dzq5hkR3wnyYaPGgbJby3ZQVWunMZQK8CgMc6n1kU9hrUK12i8vGez6FSAV3mN81AI7gnl hpm4lkQmcCbthaP2zHnh+DtUvDnKSOE/8txrjtnaL3FEpCzz5A2rGczBH5KbVpUjpAbe66 1Zv5QzJVKaJJpM2frt48tWCk8z17Og+bG0DoLL5ON9eyh1YP/tnTd0/Yqtv2nzxtai5Hsh IaMPxjRqDXPUlbtxOzyZXMIyBawIBjtqthJoAq0zFiX22WwBNp6H/K3Ea8b9Xw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -2.40 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 9F9FA247A7 X-Spam-Score: -2.40 X-Migadu-Scanner: scn0.migadu.com X-TUID: ZDJsMbdUVmuw Hi, I have a 'sh' source block which produces a table which I then want to plot with a 'python' source block: #+NAME: code;raw_data #+HEADER: :var user="loris" #+BEGIN_SRC sh ps -u loris -o etimes= #+END_SRC #+NAME: tab;raw_data #+RESULTS: code;raw_data... #+HEADER: :var df=tab;raw_data #+HEADER: :var user="loris" #+BEGIN_SRC python :results file :var f="process_times.pdf" import numpy as np import matplotlib.pyplot as plt # flatten list x = [item for sublist in df for item in sublist] plt.hist(x, bins=10) plt.xlabel("time [s]") plt.ylabel("number of processes") plt.title("user: " + user) plt.savefig(f) return f #+END_SRC How can I avoid having to declare the variable 'user' for both blocks? Cheers, Loris -- This signature is currently under construction.