Re: [O] [babel] Setting python interpreter version on per-block or per-subtree basis

2014-04-25 Thread Ian Barton
Is there an easy way to specify the python version to use for a particular block or sub-tree? My use case is that I have mainly migrated to python 3, but there is still the occasional library that has not been updated yet, so I need to fall back to python 2.7 for some tasks. I can work around

Re: [O] [babel] Setting python interpreter version on per-block or per-subtree basis

2014-04-25 Thread Eric Schulte
The attached patch should allow the specification of the python command through a new :python header argument. E.g., #+begin_src python :python /path/to/python2 return 1 + 2 #+end_src If someone who actually uses python could confirm that it works as expected then I'll be happy to apply it.

Re: [O] [babel] Setting python interpreter version on per-block or per-subtree basis

2014-04-25 Thread William Henney
Dear Sacha, Ian, and Eric Thanks very much for your replies. Sacha's way is a clever idea and works fine, but I think Eric's patch is the best solution in the long term. Please see attached test file - the patch works perfectly. Although I did have to study the manual carefully to work out how

Re: [O] [babel] Setting python interpreter version on per-block or per-subtree basis

2014-04-25 Thread Eric Schulte
I've just applied this patch. Thanks for the very attached nice test and demonstration file. Best, William Henney when...@gmail.com writes: Dear Sacha, Ian, and Eric Thanks very much for your replies. Sacha's way is a clever idea and works fine, but I think Eric's patch is the best

[O] [babel] Setting python interpreter version on per-block or per-subtree basis

2014-04-24 Thread William Henney
Hi Is there an easy way to specify the python version to use for a particular block or sub-tree? My use case is that I have mainly migrated to python 3, but there is still the occasional library that has not been updated yet, so I need to fall back to python 2.7 for some tasks. I can work

Re: [O] [babel] Setting python interpreter version on per-block or per-subtree basis

2014-04-24 Thread Sacha Chua
William Henney when...@gmail.com 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