emacs-orgmode
[Top][All Lists]
Advanced

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

Re: Async Python src block behavior with :dir header property


From: Nasser Alkmim
Subject: Re: Async Python src block behavior with :dir header property
Date: Wed, 31 Jan 2024 16:00:44 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Ihor Radchenko <yantar92@posteo.net> writes:

> Do you mean that you have no problem after you add :mkdirp yes?

No. Just that I can reproduce the examples in the first message.

Here is a clearer description of the unwanted behavior:

1. emacs -Q ~/Desktop/testasync.org

Then evaluate (require 'ob-python) and paste this source block:

#+begin_src python :dir otherdir :async yes :session pysession :return figname 
:results file value :mkdirp yes
import matplotlib.pyplot as plt
plt.figure(figsize=(1, 1))
plt.plot([1, 2])
figname = 'fig.svg'
plt.savefig(figname)
#+end_src

Execute the source block, which results in 

#+RESULTS:
[[file:fig.svg]]

However, the figure is in ~/Desktop/otherdir/fig.svg and the link is
wrong.  If I run the same block without the ':async' and ':session', I
get the right relative path to the figure:

#+RESULTS:
[[file:otherdir/fig.svg]]

Best regards,

-- 
Nasser Alkmim 
 +43 677 6408 9171



reply via email to

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