From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thomas S. Dye" Subject: Re: org-babel: Why isn't =:results value= working with (my) python? Date: Thu, 4 Feb 2010 05:27:41 -1000 Message-ID: <3F2CB3C4-F33B-47C2-BFF3-84774D0A3F07@tsdye.com> References: <852251.91747.qm@web65608.mail.ac4.yahoo.com> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: multipart/mixed; boundary="===============2141356305==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nd3cV-0006Ec-RK for emacs-orgmode@gnu.org; Thu, 04 Feb 2010 10:27:51 -0500 Received: from [199.232.76.173] (port=46491 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nd3cV-0006E0-C6 for emacs-orgmode@gnu.org; Thu, 04 Feb 2010 10:27:51 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nd3cS-0001mA-9v for emacs-orgmode@gnu.org; Thu, 04 Feb 2010 10:27:50 -0500 Received: from outbound-mail-360.bluehost.com ([66.147.249.254]:54425) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1Nd3cR-0001lU-HU for emacs-orgmode@gnu.org; Thu, 04 Feb 2010 10:27:47 -0500 In-Reply-To: <852251.91747.qm@web65608.mail.ac4.yahoo.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Scott May Cc: emacs-orgmode@gnu.org --===============2141356305== Content-Type: multipart/alternative; boundary=Apple-Mail-24--772746922 --Apple-Mail-24--772746922 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit On Feb 4, 2010, at 5:06 AM, Scott May wrote: > Using org-babel, the following example produces no output for me > when I execute using C-c C-c: > > #+begin_src python :results value > 2 + 2 > #+end_src > > #+results: > : None > > In my messages buffer I see the following: > > : (Shell command succeeded with no output) > > Now the equivalent emacs-lisp example does work: > > #+begin_src emacs-lisp :results value > (+ 2 2) > #+end_src > > #+results: > : 4 > > Furthermore, > > #+begin_src python :results output > print(2 + 2) > #+end_src > > #+results: > : 4 > > works as expected. > > Am I missing something obvious? Is the problem with my python setup, > or perhaps org-babel-python? > > I have tested this on both my Windows and Ubuntu setups. I am using > org version 6.34trans. > > Cheers, > Scott > Hi Scott, You need :session. #+begin_src python :session :results value 2 + 2 #+end_src #+results: : 4 hth, Tom Thomas S. Dye, Ph.D. T. S. Dye & Colleagues, Archaeologists, Inc. Phone: (808) 529-0866 Fax: (808) 529-0884 http://www.tsdye.com --Apple-Mail-24--772746922 Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable
On Feb 4, 2010, at = 5:06 AM, Scott May wrote:

Using = org-babel, the following example produces no output for me when I = execute using C-c C-c:

#+begin_src python :results value
2 + = 2
#+end_src

#+results:
: None

In my messages buffer = I see the following:

: (Shell command succeeded with no = output)

Now the equivalent emacs-lisp example does = work:

#+begin_src emacs-lisp :results value
(+ 2 = 2)
#+end_src

#+results:
: 4

Furthermore, =

#+begin_src python :results output
print(2 + = 2)
#+end_src

#+results:
: 4

works as = expected.

Am I missing something obvious? Is the problem with my = python setup, or perhaps org-babel-python?

I have tested this on = both my Windows and Ubuntu setups. I am using org version = 6.34trans.

Cheers,
Scott


Hi Scott,

You need = :session.

#+begin_src python :session = :results value
2 + = 2
#+end_src

#+results:
: = 4

hth,
Tom

Thomas S. Dye, Ph.D.

T. S. Dye & Colleagues, = Archaeologists, Inc.

Phone: (808) 529-0866 Fax: (808) 529-0884

=
= --Apple-Mail-24--772746922-- --===============2141356305== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============2141356305==--