From mboxrd@z Thu Jan 1 00:00:00 1970 From: R C Subject: ob-python.el: questions about output Date: Sun, 23 Feb 2020 11:43:41 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000082a788059f4526f3" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:59891) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j5z2X-0003t7-SY for emacs-orgmode@gnu.org; Sun, 23 Feb 2020 16:43:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j5z2W-0005Z7-LB for emacs-orgmode@gnu.org; Sun, 23 Feb 2020 16:43:53 -0500 Received: from mail-qt1-x830.google.com ([2607:f8b0:4864:20::830]:37952) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j5z2W-0005Yu-FN for emacs-orgmode@gnu.org; Sun, 23 Feb 2020 16:43:52 -0500 Received: by mail-qt1-x830.google.com with SMTP id i23so5334327qtr.5 for ; Sun, 23 Feb 2020 13:43:52 -0800 (PST) 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-mx.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --00000000000082a788059f4526f3 Content-Type: text/plain; charset="UTF-8" The approach proposed for graphical output at https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-python.html is ```` #+begin_src python :results file import matplotlib, numpy matplotlib.use('Agg') import matplotlib.pyplot as plt fig=plt.figure(figsize=(4,2)) x=numpy.linspace(-15,15) plt.plot(numpy.sin(x)/x) fig.tight_layout() plt.savefig('images/python-matplot-fig.png') return 'images/python-matplot-fig.png' # return filename to org-mode #+end_src ```` and to use :results output for displaying stdout. 1. Is it possible to have both types of output displayed from a single src block to avoid having to duplicate the src block, using :exports results for one and :exports both for the other? 2. Is there an option to suppress export of the the last line of the src block which is specific to the ob-python implementation. Thanks, RC --00000000000082a788059f4526f3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

The approach proposed for gra= phical output at https://orgmode.org/worg/org-contrib/babel/langua= ges/ob-doc-python.html is

````
#+begin_src python :results file
import matplotlib, numpy
matplotlib.use('Agg')
import matplotlib.pyplot as plt
fig=3Dplt.figure(figsize=3D(4,2))
x=3Dnumpy.linspace(-15,15)
plt.plot(numpy.sin(x)/x)
fig.tight_layout()
plt.savefig('images/python-matplot-fig.png')
return 'images/python-matplot-fig.png' # return filename to org-mod=
e
#+end_src
````
and to use :results outpu=
t for displaying stdout.
1. Is it possible to have both= types of output displayed from a single src block to avoid having to dupli= cate the src block, using :exports results for one and :exports both for th= e other?
2. Is there an option to suppress export of the the last= line of the src block which is specific to the ob-python implementation.

Thanks,
RC<= /div>
--00000000000082a788059f4526f3--