From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thibault Marin Subject: Re: Problem with python source block Date: Sat, 26 May 2018 00:29:45 -0500 Message-ID: <87po1j6l2u.fsf@dell-desktop.WORKGROUP> References: Reply-To: thibault.marin@gmx.com Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36909) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMRmC-0002gz-FH for emacs-orgmode@gnu.org; Sat, 26 May 2018 01:30:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fMRm9-0007ky-4f for emacs-orgmode@gnu.org; Sat, 26 May 2018 01:30:00 -0400 Received: from mout.gmx.net ([212.227.15.18]:34207) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fMRm8-0007k2-RU for emacs-orgmode@gnu.org; Sat, 26 May 2018 01:29:57 -0400 In-reply-to: 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: "Doyley, Marvin M." Cc: "emacs-orgmode@gnu.org" Hi, For what it's worth, I cannot reproduce it on Org mode version 9.1.13 (release_9.1.13-763-g2621db) with -Q; the file is properly produced. I get the same error if I add the `session' header argument, maybe it is set elsewhere? Hope it helps. thibault Doyley, Marvin M. writes: > Hi there, > > When I run the following code I get an error, does anybody know how to fix this > > I am using the latest version of org-mode. > > Thanks, > M > > > #+BEGIN_SRC python :results file > import numpy as np > import matplotlib.pyplot as plt > import seaborn as sns > x = np.random.rand(100) > y= np.cos(x) > plt.plot(x,y) > plt.savefig('test.png') > return 'test.png' > #+END_SRC > > #+RESULTS: > [[file: File "Org SRC", line 8 > return 'test.png' > ^ > SyntaxError: 'return' outside function > ]]