From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shiyuan Subject: Re: babel python example not reproducible Date: Mon, 16 Jun 2014 23:21:30 -0700 Message-ID: References: <87egyox566.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c2081090deee04fc02271d Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39284) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wwmlz-0002tL-4z for emacs-orgmode@gnu.org; Tue, 17 Jun 2014 02:21:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wwmlv-0002sO-Rp for emacs-orgmode@gnu.org; Tue, 17 Jun 2014 02:21:35 -0400 Received: from mail-ve0-x231.google.com ([2607:f8b0:400c:c01::231]:39087) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wwmlv-0002s8-Mn for emacs-orgmode@gnu.org; Tue, 17 Jun 2014 02:21:31 -0400 Received: by mail-ve0-f177.google.com with SMTP id i13so3443807veh.22 for ; Mon, 16 Jun 2014 23:21:30 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Doyley, Marvin" Cc: emacs-orgmode@gnu.org --001a11c2081090deee04fc02271d Content-Type: text/plain; charset=UTF-8 Hi all, I found a solution to fix the echo problem of the emacs python shell: http://stackoverflow.com/questions/8060609/python-interpreter-in-emacs-repeats-lines That is, in the Interior Python buffer, do M-: (setq comint-process-echoes t) ;; or nil Now, if I enter command directly in the interior python buffer, the command is not echoed and this is what I want. However, When I evaluate the python src code block in org-mode(by `C-c C-c`), the problem persists. I notice every time I evaluate the block, I see 'org_babel_python_eoe' in the interior python buffer. I stumbled on a very strange emacs behavior. When I fiddled around, at some point, I produced the correct answer as the manual. I thought I got the right setup, but when I saved everything and restarted emacs, problem persists. Will it be a sign of anything wrong? What's even stranger is that: the evaluation for the first time gives different results from the evaluation for the second time, on exactly the same src_block: This is what I got when I evaluation the code block for the first time: ------------------------------------- #+BEGIN_SRC python :results output :session foo x=100 print "hello" 2 print "bye" #+END_SRC #+RESULTS: #+begin_example x=100 >>> print "hello" >>> hello 2 2 print "bye" bye #+end_example ----------------------------------------------- ------------------------------------------------------- The following is what I got when I evaluate the same block again: #+BEGIN_SRC python :results output :session foo x=100 print "hello" 2 print "bye" #+END_SRC #+RESULTS: : x=100 : print "hello" : hello : 2 : 2 : print "bye" : bye : : Notice that the prompt symbol ">>>" is in the result for the first evaluation but not in the second evaluation. Also the result is not embedded in the #+being_example/#+end_example for the second evaluation. I want to hunt down the problem. Any hints/helps is greatly appreciated. Shiyuan On Mon, Jun 16, 2014 at 9:12 AM, Doyley, Marvin wrote: > Hi Eric, > > Thanks for showing me the smart way of doing this. > > cheers, > M > -- > > > > --001a11c2081090deee04fc02271d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi all,=C2=A0
=C2=A0 =C2=A0 =C2=A0 I found a solution = to fix the echo problem of the emacs python shell:=C2=A0http://stackoverflow.com/questions/8060609/python-inte= rpreter-in-emacs-repeats-lines

That is, in the Interior Python buffer, do=C2=A0
<= div>M-: (set= q comint-process-echoes t) ;; or nil

Now, if I enter command directly in the interior python= buffer, the command is not echoed and this is what I want.=C2=A0

However, When I evaluate the python src code block in org-m= ode(by `C-c C-c`), the problem persists. I notice every time I evaluate the= block, I see 'org_babel_python_eoe' in the interior python buffer.= =C2=A0

I =C2=A0stumbled on a very strange emacs behavior. When= I fiddled around, at some point, I produced the correct answer as the manu= al. I thought I got the right setup, but when I saved everything and restar= ted emacs, problem persists. Will it be a sign of anything wrong?=C2=A0

What's even stranger is that: the evaluation for th= e first time gives different results from the evaluation for the second tim= e, =C2=A0on exactly the same src_block:=C2=A0

This= is what I got when I evaluation the code block for the first time:=C2=A0
-------------------------------------
#+BEGIN_SRC pytho= n :results output :session foo
x=3D100
print "hell= o"
2
print "bye"
#+END_SRC

#+RESULTS:
#+begin_example

x=3D100
>>> print "hello"
>= ;>> hello
2
2
print "bye"
bye


#+end_example
<= div>-----------------------------------------------
-------------= ------------------------------------------

The fol= lowing is what I got when I evaluate the same block again:=C2=A0
#+BEGIN_SRC python :results output :session foo
x=3D100=
print "hello"
2
print "bye&qu= ot;
#+END_SRC

#+RESULTS:
: x= =3D100
: print "hello"
: hello
: 2
: = 2
: print "bye"
: bye
:=C2=A0
=
:=C2=A0

Notice that the prompt symbol &= quot;>>>" is in the result for the first evaluation but not i= n the second evaluation. =C2=A0Also the result is not embedded in the #+bei= ng_example/#+end_example for the second evaluation.=C2=A0

I want to hunt down the problem. Any hints/helps is gre= atly appreciated.=C2=A0

Shiyuan=C2=A0



On Mon, Jun 16, 2014 at 9:12 AM, Doyley, Marvin <mdoyley@ur.rochest= er.edu> wrote:
Hi Eric,

Thanks for showing me the smart way of doing this.

cheers,
M
--




--001a11c2081090deee04fc02271d--