Re: [O] Extraneous output from Python code blocks using :session option

2015-03-15 Thread Kyle Meyer
Nicolas Goaziou m...@nicolasgoaziou.fr wrote: [...] You also need to list new functions and variables in commit message, e.g., Thanks. I'll update the commit messages. Wouldn't it be better to find the situations above at the source? If may be due to some indentation problem at the

Re: [O] Extraneous output from Python code blocks using :session option

2015-03-14 Thread Nicolas Goaziou
Kyle Meyer k...@kyleam.com writes: Thanks for your comments. I've attached updated patches. Thanks. Subject: [PATCH 1/2] ob-python.el: Allow indented code in sessions * lisp/ob-python.el (org-babel-python-evaluate-session): Recognize indented code in session and treat it differently to

Re: [O] Extraneous output from Python code blocks using :session option

2015-03-13 Thread Kyle Meyer
Kyle Meyer k...@kyleam.com wrote: Richard Stanton stan...@haas.berkeley.edu wrote: This looks great. While we're patching this code, why does having blank lines inside function definitions cause such problems in :session mode? I think this is because the lines are being sent one by one, so

Re: [O] Extraneous output from Python code blocks using :session option

2015-03-13 Thread Nicolas Goaziou
Hello, Kyle Meyer k...@kyleam.com writes: I've attached two patches. The first one is a proposed way to deal with the indentation issues in sessions. It is very similar to what python.el does for multiline input (use a temporary file and then execute that from the shell). The second is an

Re: [O] Extraneous output from Python code blocks using :session option

2015-03-13 Thread Kyle Meyer
Nicolas Goaziou m...@nicolasgoaziou.fr wrote: Hello, Kyle Meyer k...@kyleam.com writes: I've attached two patches. The first one is a proposed way to deal with the indentation issues in sessions. It is very similar to what python.el does for multiline input (use a temporary file and then

Re: [O] Extraneous output from Python code blocks using :session option

2015-03-12 Thread Richard Stanton
This looks great. While we're patching this code, why does having blank lines inside function definitions cause such problems in :session mode? It would be nice if you could just type any valid Python code and have it execute (like you can in an IPython notebook cell) On Mar 12, 2015, at

Re: [O] Extraneous output from Python code blocks using :session option

2015-03-12 Thread John Kitchin
Nice. I hope this makes it into org-mode one day. In the mean time, I crafted an approach with another hook function that is described here: http://kitchingroup.cheme.cmu.edu/blog/2015/03/12/Making-org-mode-Python-sessions-look-better/ This can be done in an init file. Kyle Meyer writes:

Re: [O] Extraneous output from Python code blocks using :session option

2015-03-12 Thread Kyle Meyer
Richard Stanton stan...@haas.berkeley.edu wrote: This looks great. While we're patching this code, why does having blank lines inside function definitions cause such problems in :session mode? I think this is because the lines are being sent one by one, so sending the blank line causes an

Re: [O] Extraneous output from Python code blocks using :session option

2015-03-12 Thread Kyle Meyer
John Kitchin jkitc...@andrew.cmu.edu wrote: Nice. I hope this makes it into org-mode one day. In the mean time, I crafted an approach with another hook function that is described here: http://kitchingroup.cheme.cmu.edu/blog/2015/03/12/Making-org-mode-Python-sessions-look-better/ Good idea.

Re: [O] Extraneous output from Python code blocks using :session option

2015-03-11 Thread Kyle Meyer
Richard Stanton stan...@haas.berkeley.edu wrote: I'm trying to use the :session option so I can import modules, etc., just once at the beginning of my document, like with am IPython notebook. Unfortunately, the output from these code blocks contains some extraneous characters. For example:

[O] Extraneous output from Python code blocks using :session option

2015-03-10 Thread Richard Stanton
I'm trying to use the :session option so I can import modules, etc., just once at the beginning of my document, like with am IPython notebook. Unfortunately, the output from these code blocks contains some extraneous characters. For example: #+BEGIN_SRC python :session :results output a = 2 b