From mboxrd@z Thu Jan 1 00:00:00 1970 From: Darlan Cavalcante Moreira Subject: Re: What is output for org-babel? Date: Thu, 05 Nov 2009 11:26:13 -0300 Message-ID: <4af2e095.0706c00a.3de8.57c8@mx.google.com> References: Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N63IJ-0008Cd-L5 for emacs-orgmode@gnu.org; Thu, 05 Nov 2009 09:26:35 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N63IF-00089S-31 for emacs-orgmode@gnu.org; Thu, 05 Nov 2009 09:26:35 -0500 Received: from [199.232.76.173] (port=43977 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N63IE-00089P-UO for emacs-orgmode@gnu.org; Thu, 05 Nov 2009 09:26:30 -0500 Received: from mail-yw0-f194.google.com ([209.85.211.194]:37298) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N63IE-0004wu-Mn for emacs-orgmode@gnu.org; Thu, 05 Nov 2009 09:26:30 -0500 Received: by ywh32 with SMTP id 32so29620ywh.14 for ; Thu, 05 Nov 2009 06:26:30 -0800 (PST) In-Reply-To: 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: andrea Crotti Cc: emacs-orgmode@gnu.org COmments are inline. At Thu, 5 Nov 2009 11:17:39 +0000 (UTC), andrea Crotti wrote: > > I'm with org-mode 6.31a, I was trying to > get output in the exported files but I never see the output. > > So I investigate and for example this > > #+BEGIN_SRC python > import os; os.listdir(os.getcwd()) > #+END_SRC This does not return anything for me either, but #+BEGIN_SRC python import os os.listdir(os.getcwd()) #+END_SRC works as expected. This is strange, since "import os; os.listdir(os.getcwd())" is valid and will work if typed in the python interpreter directly. > > doesn't return any output while this > > #+BEGIN_SRC python > "hello" > #+END_SRC > > does and this: > > #+BEGIN_SRC python > return "hello" > #+END_SRC > Again doesn't. I don't think this is suppose to work. As I understand org-babel send this code to python without any processing but you are not inside a python function. Therefore this is as if you have typed 'return "hello"' in the interpreter and it will result in an error. That's why no output is shown. Change "#+BEGIN_SRC python" to "#+BEGIN_SRC python :results output" and you will see the error. However, if the code is sent to the python interpreter as it is, then it bugs me why "import os; os.listdir(os.getcwd())" didn't work. - Darlan > I guess that the returned value is depending also on the language, > but in general what's the rule? > > Another little thing, I have a file with many haskell source blocks. > They are separated because they are different answers, > but if they are loaded separately they don't work. > So is there a way to take all the source code and load it at once? > > Something like more or less: > (append-to-buffer "haskell-buf" (get-code "exercises.org")) > > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode