From mboxrd@z Thu Jan 1 00:00:00 1970 From: Karl Voit Subject: Re: [babel] sbe not working properly (resolved) Date: Sat, 13 Apr 2013 10:01:21 +0200 Message-ID: <2013-04-13T09-58-32@devnull.Karl-Voit.at> References: <2013-04-11T16-21-52@devnull.Karl-Voit.at> <5166fa3a.054bec0a.3a8e.5d36@mx.google.com> Reply-To: news1142@Karl-Voit.at Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:37519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQvOx-0003yL-8I for emacs-orgmode@gnu.org; Sat, 13 Apr 2013 04:01:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQvOv-0006EN-Jm for emacs-orgmode@gnu.org; Sat, 13 Apr 2013 04:01:35 -0400 Received: from plane.gmane.org ([80.91.229.3]:51064) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQvOv-0006EB-D6 for emacs-orgmode@gnu.org; Sat, 13 Apr 2013 04:01:33 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UQvOs-0002JO-Av for emacs-orgmode@gnu.org; Sat, 13 Apr 2013 10:01:30 +0200 Received: from mail.michael-prokop.at ([88.198.6.110]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 13 Apr 2013 10:01:30 +0200 Received: from news1142 by mail.michael-prokop.at with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 13 Apr 2013 10:01:30 +0200 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: emacs-orgmode@gnu.org * Christian Moe wrote: > > Hi, Hi! > I cannot replicate Karl's problem. I copied the code examples, and got > the right results on Org 8.0-pre (pulled this morning). > > I did have to make one change -- Babel wouldn't recognize the variables > until I passed them with :var rather than in parens after the codeblock > name. (I saw there was some discussion on dropping the latter syntax; > whoa -- has it already happened?) I can confirm that using the :var syntax, it is working properly: #+NAME: epoch2day #+BEGIN_SRC python :results output :var epoch=1262675465119 time = epoch import datetime strtime = str(time) datetimestamp = datetime.datetime.utcfromtimestamp(int(strtime[:10])) print datetimestamp.strftime('[%Y-%m-%d %a %H:%M:%S]') #+END_SRC #+RESULTS: epoch2day : [2010-01-05 Tue 07:11:05] | epoch | day | |---------------+---------------------------| | 1262675465119 | [2010-01-05 Tue 07:11:05] | | 123456 | [1970-01-02 Fri 10:17:36] | | 99998754 | [1973-03-03 Sat 09:25:54] | #+TBLFM: $2='(sbe epoch2day (epoch $1)) ... works (and enriches my Org-mode capabilities enourmously! :-). #+name: add1 #+begin_src python :results silent :var x=1 return x + 1 #+end_src #+RESULTS: add1 : 2 | foo | bar | 3 | 4 | #+TBLFM: @1$4='(sbe add1 (x $3)) ... does work as well. Thanks for pointing me to the change of syntax. -- mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode: > get Memacs from https://github.com/novoid/Memacs < https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github