1

I would like to capture both stdout and stderr from org-mode code block to output.

#+begin_src python :results output
import sys
print("hello stdout", file=sys.stdout)
print("hello stderr", file=sys.stderr)
#+end_src

#+RESULTS:
: hello stdout

Current sample only captured stdout text, how can I capture both?

lucky1928
  • 1,622
  • 8
  • 28
  • Does [this](https://kitchingroup.cheme.cmu.edu/blog/2014/12/21/Capturing-stderr-from-Python-in-org-mode-take-2/) help? – NickD Sep 28 '22 at 16:10
  • here are som elinks on this topic that might help you: https://kitchingroup.cheme.cmu.edu/blog/2015/01/04/Redirecting-stderr-in-org-mode-shell-blocks/ https://necromuralist.github.io/posts/org-babel-stderr-results/ https://emacs.stackexchange.com/questions/48835/help-me-avoid-true-in-org-babel-bash-statements – orgbabeler Nov 01 '22 at 07:00

0 Answers0