From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jack Kamm Subject: Re: Make ob-python.el support ":results pp" pretty print result Date: Thu, 20 Feb 2020 08:56:21 -0800 Message-ID: <87mu9djiyy.fsf@gmail.com> References: <87y2sx6yvl.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:35035) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4p7h-0001oL-JF for emacs-orgmode@gnu.org; Thu, 20 Feb 2020 11:56:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j4p7g-0003jZ-MU for emacs-orgmode@gnu.org; Thu, 20 Feb 2020 11:56:25 -0500 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]:35301) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j4p7g-0003iK-E9 for emacs-orgmode@gnu.org; Thu, 20 Feb 2020 11:56:24 -0500 Received: by mail-pj1-x1034.google.com with SMTP id q39so1135263pjc.0 for ; Thu, 20 Feb 2020 08:56:24 -0800 (PST) In-Reply-To: <87y2sx6yvl.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-mx.org@gnu.org Sender: "Emacs-orgmode" To: numbchild@gmail.com, Org Mode Hi stardiviner, stardiviner writes: > I found ob-python does not support ":results pp" pretty print result. And Python > has a module "pprint". What about add support this? Well, there is code in ob-python.el that uses the pprint module when ":results pp", but I must admit I've never used it and don't know whether it is currently working. I'm also unsure there's a difference in how session and non-session blocks deal with this. I'll plan to test it out later this weekend or next week and see if I can fix any issues. Or, if you're able, please feel free to submit a patch (but please let me know if you plan to work on this, so we can avoid duplicating effort). Ideally, a patch for this would also include a unit test, to make sure this doesn't break in future.