From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id cItcJbpaBGCfEQAA0tVLHw (envelope-from ) for ; Sun, 17 Jan 2021 15:41:46 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id QP0PIbpaBGALRQAAbx9fmQ (envelope-from ) for ; Sun, 17 Jan 2021 15:41:46 +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 E184D940485 for ; Sun, 17 Jan 2021 15:41:45 +0000 (UTC) Received: from localhost ([::1]:43480 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l1ABU-0001oF-U4 for larch@yhetil.org; Sun, 17 Jan 2021 10:41:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51540) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1AAr-0001mL-8K for emacs-orgmode@gnu.org; Sun, 17 Jan 2021 10:41:05 -0500 Received: from w4.tutanota.de ([81.3.6.165]:51952) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1AAo-0000NT-B7 for emacs-orgmode@gnu.org; Sun, 17 Jan 2021 10:41:05 -0500 Received: from w3.tutanota.de (unknown [192.168.1.164]) by w4.tutanota.de (Postfix) with ESMTP id 5ADE510602F3 for ; Sun, 17 Jan 2021 15:40:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1610898058; s=s1; d=tuta.io; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Cc:Date:Date:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:Sender; bh=3zAq6mHU+eetCw16dnOMqm5WYzMWoynOoNU9WwlzkZk=; b=W2yMuV/QCqVxGo0mjozOwWM9lkHR0VjgtPh3NH0WR01MOSAX266lxR2lM21GRrc4 F4S0usJ/EULhgITNaI5XRHRzUfZ/TyaD0USS7CzVdOhHlfbDDf0eN7YHgTBg5KQlBmb JvdektpGebh9TTEC5/c9Tl2KWUTi/VLi+0fiST4RPWudSAuBWzDs27PR6uFKbFBZNSM ph9g60xPLRaegt5zxopRUPs9F0AeKCMozensbCmCu9yUB/TpliL5LT08yS2JSOpWEpr 4I4zANCMb/dA4fscj9IEHx+pXahRfr/5Q2xgdt+FPWGqymrXe2KL+O88YAFj6rt0veh cTSbV3L4ng== Date: Sun, 17 Jan 2021 16:40:58 +0100 (CET) To: Emacs Orgmode Message-ID: Subject: How to not include newlines in strip-export? MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_193137_1793146146.1610898058358" Received-SPF: pass client-ip=81.3.6.165; envelope-from=karol.wojcik@tuta.io; helo=w4.tutanota.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-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" Reply-to: =?UTF-8?Q?Karol_W=C3=B3jcik?= From: karol.wojcik--- via "General discussions about Org-mode." X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.86 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tuta.io header.s=s1 header.b="W2yMuV/Q"; dmarc=pass (policy=none) header.from=gnu.org; 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: E184D940485 X-Spam-Score: -1.86 X-Migadu-Scanner: scn0.migadu.com X-TUID: IR8caIZRKwOP ------=_Part_193137_1793146146.1610898058358 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I'm using the following snippet for saving the plot in python snippets #+NAME: save-file #+BEGIN_SRC python :results silent :var filename=3D"filename" plt=3D"plt" := exports none return f"\nfname =3D 'assets/' + filename + '.png'\nplt.savefig(fname)\nfna= me" #+END_SRC Using it like so #+BEGIN_SRC python :var fig=3D1 filename=3D"some-filename" :noweb strip-exp= ort :results file :session t :exports both :cache yes import matplotlib.pyplot as plt plt.plot(1, 1) <> #+END_SRC The issue is that `save-file` adds some extra newlines in export which I wo= uld rather omit. What am I doing wrong? Best Regards, Karol W=C3=B3jcik ------=_Part_193137_1793146146.1610898058358 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I'm using the following snippet for saving the plot in python snippet= s

#+NAME: save-file
#+BEGIN_SRC = python :results silent :var filename=3D"filename" plt=3D"plt" :exports none=
return f"\nfname =3D 'assets/' + filename + '.png'\nplt.save= fig(fname)\nfname"
#+END_SRC

Usi= ng it like so

#+BEGIN_SRC python :var fig=3D1 file= name=3D"some-filename" :noweb strip-export :results file :session t :export= s both :cache yes
import matplotlib.pyplot as plt

plt.plot(1, 1)

<<save-= file("filename", "plt")>>
#+END_SRC

<= /div>
The issue is that `save-file` adds some extra newlines in export = which I would rather omit. What am I doing wrong?

<= div style=3D"16px">Best Regards,
Karol W=C3=B3= jcik
------=_Part_193137_1793146146.1610898058358--