From mboxrd@z Thu Jan 1 00:00:00 1970 From: Karl Voit Subject: Re: Mixing Python2 and Python3 blocks in one file Date: Tue, 17 May 2016 16:54:15 +0200 Message-ID: <2016-05-17T16-45-38@devnull.Karl-Voit.at> References: <2016-05-08T10-21-00@devnull.Karl-Voit.at> Reply-To: Karl Voit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60880) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2gOL-0007sA-V4 for emacs-orgmode@gnu.org; Tue, 17 May 2016 10:54:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b2gOI-0001HE-IR for emacs-orgmode@gnu.org; Tue, 17 May 2016 10:54:37 -0400 Received: from plane.gmane.org ([80.91.229.3]:54456) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2gOI-0001Gh-Bi for emacs-orgmode@gnu.org; Tue, 17 May 2016 10:54:34 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1b2gOF-0002mX-Fc for emacs-orgmode@gnu.org; Tue, 17 May 2016 16:54:31 +0200 Received: from friends.grml.info ([136.243.234.19]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 17 May 2016 16:54:31 +0200 Received: from news1142 by friends.grml.info with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 17 May 2016 16:54:31 +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" To: emacs-orgmode@gnu.org Hi William * William Henney wrote: > > On Sun, May 8, 2016 at 3:31 AM, Karl Voit wrote: > > Python2 and Python3 are two different languages. Unfortunately, >> Org-mode only uses ~#+BEGIN_SRC python~ for both and uses >> python-shell-interpreter to choose/switch the compiler. >> >> Shouldn't Org-mode introduce ~#+BEGIN_SRC python2~ and ~#+BEGIN_SRC >> python3~ to solve this issue in a clean way? >> >> ~#+BEGIN_SRC python~ can still default to python2. >> > You can use the :python header argument to the source block, which allows > you to specify the path to the python interpreter: > > #+BEGIN_SRC python :python /Users/will/anaconda/envs/py27/bin/python Cool, I did not find this parameter yet. Is this undocumented? http://orgmode.org/org.html does not contain the string ":python:" and http://orgmode.org/org.html#Language_002dspecific-header-arguments also does not mention this parameter. > Also see original discussion at > https://lists.gnu.org/archive/html/emacs-orgmode/2014-04/msg01042.html Most interesting to me, thank you. With the parameter above as a workaround, I can accomplish the things I want to do for now. However, I still do think that Python2 and Python3 as different languages demand different block identifiers. #+BEGIN_SRC python -> defaults to the default python interpreter #+BEGIN_SRC python2 -> uses Python2 #+BEGIN_SRC python3 -> uses Python3 Don't you think? -- 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