emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Problem with python source block


From: John Kitchin
Subject: Re: [O] Problem with python source block
Date: Sat, 26 May 2018 08:18:30 -0700

The default for :results in scimax is output. You need to specify that you want the value for your block.

This worked for me.

#+BEGIN_SRC python :results value 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

John

-----------------------------------
Professor John Kitchin 
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803

On Sat, May 26, 2018 at 7:22 AM, Doyley, Marvin M. <address@hidden> wrote:
Hi there,

The problem seem to be cause by scimax-org-babel-python.el.
When I disable this works fine, but doing this disables asynchronous execution.

John do you have any suggestions what is going on ?

Cheers,
M


On May 26, 2018, at 9:16 AM, Doyley, Marvin M. <address@hidden> wrote:


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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]