From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Doyley, Marvin M." Subject: Re: Problem with python source block Date: Sat, 26 May 2018 13:16:22 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/signed; boundary="Apple-Mail=_2AE2C1F7-9A7D-4060-A504-205A463469F8"; protocol="application/pgp-signature"; micalg=pgp-sha512 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50778) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMZ3d-0004kw-Mm for emacs-orgmode@gnu.org; Sat, 26 May 2018 09:16:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fMZ3Y-0002EX-Lq for emacs-orgmode@gnu.org; Sat, 26 May 2018 09:16:29 -0400 Received: from mail-bl2nam02on0096.outbound.protection.outlook.com ([104.47.38.96]:34336 helo=NAM02-BL2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fMZ3Y-0002Dp-9w for emacs-orgmode@gnu.org; Sat, 26 May 2018 09:16:24 -0400 Content-Language: en-US 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: "emacs-orgmode@gnu.org" --Apple-Mail=_2AE2C1F7-9A7D-4060-A504-205A463469F8 Content-Type: multipart/alternative; boundary="Apple-Mail=_B4854800-75E1-453F-B6A6-7E8DCB113264" --Apple-Mail=_B4854800-75E1-453F-B6A6-7E8DCB113264 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii Hi Thibault, thanks for the info. I will dig around my config cheers, M > 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 i>t 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 > ]] I will do some digging around in my config file. --Apple-Mail=_B4854800-75E1-453F-B6A6-7E8DCB113264 Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=us-ascii

Hi Thibault,
thanks for the info. I will dig around my config 
cheers,
M


> 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 i>t 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
> ]]


I will do some digging around in my config file.
--Apple-Mail=_B4854800-75E1-453F-B6A6-7E8DCB113264-- --Apple-Mail=_2AE2C1F7-9A7D-4060-A504-205A463469F8 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEwFvnpiA2mP2E6pbdFtmzX5oWlpcFAlsJXiUACgkQFtmzX5oW lpdnqxAAiVYYQsc5or+02vuD/3iNHIam1Arc6XXXcWmeRZtBDHVSzG2mdgqHVJKc QiW+lLTYAti7pVOL5mZPqXrpxYcwkzy/GzET+ICGsNjBZ4sZLJehcvouMM0RIV+A +l3XQpy9QqPj2v6/R0x3C2tDBxfj0weKLmEFvR2PjPGQKyyTwavJOsvBNLmXeL+S yYHgjfdzFvwSu/5jHiBxZeP0zTZjWuiYqSxxbZoh2jrfStLHL2ArGsFr++OPvkXR gjlYzhzin9tVwJwO/LaPUuC9Sl9qbqm5LGq+Ctg1y7w07fogQM+DHQ2ZG5poyMlL qBTXTpqEfRYdlvhMTV8w2xvJpLZkNIPVQCH3rSh6oPvG03uB8WpuEqy810mFKdPC DllnpHxQIJSvJIWvQVQS6Ncw5mgAK0RwqfoJoUcKch+oPUvGKqh3s1DzKjENvspj He05ypA9/RGQWGm4+Ik3R83y5b5CfRC+lyl30yPvUWLjovwPo+0pgaBJ/6fzZz5b wwYDdeuswNX7wLKTVujGNXotDETrkD2Z5e4zNPSg6cs2J8R9Si+WqJ6tVRoha+z0 ygLgsczA+LaV2JyLZaXQH6sZ+EmgNZTLw+8wFkYS+vo92mJmBfab/7gLLKX+3Rz8 P5xyFanqKjo3dfitVVw12ihpvCmW8VbHxPCfEIPyBED8ApHOw+E= =whzR -----END PGP SIGNATURE----- --Apple-Mail=_2AE2C1F7-9A7D-4060-A504-205A463469F8--