Re: [O] setting options to python interpreter for a code block

2013-09-11 Thread Eric Schulte
You could try setting org-babel-python-command to "python -m sandbox". If that doesn't work we could add a cmdline header argument to python code blocks pretty easily. Cheers, John Kitchin writes: > Hi, > I am looking at a new strategy to capture stderr and exceptions in python > code blocks.

Re: [O] setting options to python interpreter for a code block

2013-09-11 Thread John Kitchin
cool! this worked wonderfully: (setq org-babel-python-command "python -m sandbox") #+BEGIN_SRC python print 'hello' print 4 + 6 import sys print >>sys.stderr, 'message to stderr' raise Exception('baboom') #+END_SRC #+RESULTS: #+begin_example

[O] setting options to python interpreter for a code block

2013-09-11 Thread John Kitchin
Hi, I am looking at a new strategy to capture stderr and exceptions in python code blocks. Right now exceptions are not captured in the output, and neither is stderr. I made a little sandbox module that captures stdout, stderr, and exceptions and then prints them all to stdout with some minor form