From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sacha Chua Subject: Re: [babel] Setting python interpreter version on per-block or per-subtree basis Date: Thu, 24 Apr 2014 21:59:18 -0400 Message-ID: <86k3ae6ufd.fsf@sachachua.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35944) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WdVQQ-0002ai-JN for emacs-orgmode@gnu.org; Thu, 24 Apr 2014 21:59:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WdVQJ-00036p-29 for emacs-orgmode@gnu.org; Thu, 24 Apr 2014 21:59:38 -0400 Received: from plane.gmane.org ([80.91.229.3]:39916) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WdVQI-00036d-QP for emacs-orgmode@gnu.org; Thu, 24 Apr 2014 21:59:30 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WdVQH-00037d-Mr for emacs-orgmode@gnu.org; Fri, 25 Apr 2014 03:59:29 +0200 Received: from 184.175.19.126 ([184.175.19.126]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 25 Apr 2014 03:59:29 +0200 Received: from sacha by 184.175.19.126 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 25 Apr 2014 03:59:29 +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 William Henney writes: Hello, Will! > Is there an easy way to specify the python version to use for a particular > block or sub-tree? Is it something you can define an inherited property or a tag for, and then add some advice around org-babel-execute:python to check that property and use let to bind org-babel-python-comand? Maybe something like this, for example: #+begin_src emacs-lisp (defadvice org-babel-execute:python (around will activate) (if (member "python2" (org-get-tags-at)) (let ((org-babel-python-command "/path/to/python2")) ad-do-it) ad-do-it)) #+end_src * Test :python2: #+begin_src python return 1 + 3 #+end_src Sacha