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