emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Wish: babel for python3


From: Torsten Wagner
Subject: Re: [O] Wish: babel for python3
Date: Tue, 18 Oct 2011 17:56:25 +0900
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20111001 Thunderbird/7.0.1

Hi,
(sorry Arne for the eventual double post, I forogot to attt the mailing list)

Is there a way to get python3 support for Babel into org-mode
cleanly?


Something like:
-*- org-babel-python-command: "python3"


alternatively (a trick Eric is never tired to mention to me ) you could add a little lisp block which change all kind of language related aspects for you. This could include many more options and modify your emacs environment just to your personal needs for a certain language.

Make one for python2 and one for python3 and execute them dependent on which system you are going to use.

Without testing and without guarantee it should be something like the below code. To demonstrate some more functionality lets change the modebar background colour to make it more visible which python mode you are currently using.


#+srcname: python2_env
#+begin_src emacs-lisp
 (setq org-babel-python-command "python")
 (set-face-background 'modeline "#4477aa")
#+end_src

#+srcname: python3_env
#+begin_src emacs-lisp
 (setq org-babel-python-command "python3")
 (set-face-background 'modeline "#771944")
#+end_src

Sure both could be done with file bounded variables too. But know you can switch between both environments within the same buffer, e.g., to check if the code runs on both python versions

Regards

Totti



reply via email to

[Prev in Thread] Current Thread [Next in Thread]