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

2015-03-15 Thread Kyle Meyer
Nicolas Goaziou 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 beginning of the string, in

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

2015-03-14 Thread Nicolas Goaziou
Kyle Meyer 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 avoid syntax

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

2015-03-13 Thread Kyle Meyer
Nicolas Goaziou wrote: > Hello, > > Kyle Meyer 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 she

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

2015-03-13 Thread Nicolas Goaziou
Hello, Kyle Meyer 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 update of m

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

2015-03-12 Thread Kyle Meyer
Kyle Meyer wrote: > Richard Stanton 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 a

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

2015-03-12 Thread Kyle Meyer
Richard Stanton 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 issue, like typing enter wi

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

2015-03-12 Thread Kyle Meyer
John Kitchin 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. Thanks for the in

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 8:1

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: > Ric

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

2015-03-12 Thread Richard Stanton
> On Mar 11, 2015, at 11:29 AM, Kyle Meyer wrote: > > Richard Stanton 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 e

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

2015-03-11 Thread Kyle Meyer
Richard Stanton 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: > > #+BEGIN_SRC python :s

[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 =