[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to not include newlines in strip-export?
From: |
Karol Wójcik |
Subject: |
How to not include newlines in strip-export? |
Date: |
Sun, 17 Jan 2021 16:40:58 +0100 (CET) |
I'm using the following snippet for saving the plot in python snippets
#+NAME: save-file
#+BEGIN_SRC python :results silent :var filename="filename" plt="plt" :exports none
return f"\nfname = 'assets/' + filename + '.png'\nplt.savefig(fname)\nfname"
#+END_SRC
Using it like so
#+BEGIN_SRC python :var fig=1 filename="some-filename" :noweb strip-export :results file :session t :exports both :cache yes
import matplotlib.pyplot as plt
plt.plot(1, 1)
<<save-file("filename", "plt")>>
#+END_SRC
The issue is that `save-file` adds some extra newlines in export which I would rather omit. What am I doing wrong?
Best Regards,
Karol Wójcik
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- How to not include newlines in strip-export?,
Karol Wójcik <=