diff --git a/module2/ressources/rr_org/init.el b/module2/ressources/rr_org/init.el
index de9ecce56c428f778b6d962cb1f9e77d1a1f78c9..3147926f6631cc15115a2fea7d820c87018c8275 100644
--- a/module2/ressources/rr_org/init.el
+++ b/module2/ressources/rr_org/init.el
@@ -155,6 +155,8 @@ Entered on %U
))
(setq org-src-preserve-indentation t)
+(setq org-babel-python-command "python3")
+
(add-to-list 'org-structure-template-alist
'("s" "#+begin_src ?\n\n#+end_src" "\n\n"))
@@ -174,10 +176,10 @@ Entered on %U
'("p" "#+begin_src python :results output :exports both\n\n#+end_src" "\n\n"))
(add-to-list 'org-structure-template-alist
- '("P" "#+begin_src python :results output :session *python* :exports both\n\n#+end_src" "\n\n"))
+ '("P" "#+begin_src python :results output :session :exports both\n\n#+end_src" "\n\n"))
(add-to-list 'org-structure-template-alist
- '("PP" "#+begin_src python :results file :var matplot_lib_filename=(org-babel-temp-file \"figure\" \".png\") :exports both \nimport matplotlib.pyplot as plt\n\nimport numpy\nx=numpy.linspace(-15,15)\nplt.figure(figsize=(10,5))\nplt.plot(x,numpy.cos(x)/x)\nplt.tight_layout()\n\nplt.savefig(matplot_lib_filename)\nreturn(matplot_lib_filename)\n#+end_src" "\n\n"))
+ '("PP" "#+begin_src python :results output file :session :var matplot_lib_filename=(org-babel-temp-file \"figure\" \".png\") :exports both\nimport matplotlib.pyplot as plt\n\nimport numpy\nx=numpy.linspace(-15,15)\nplt.figure(figsize=(10,5))\nplt.plot(x,numpy.cos(x)/x)\nplt.tight_layout()\n\nplt.savefig(matplot_lib_filename)\nprint(matplot_lib_filename)\n#+end_src" "\n\n"))
(add-to-list 'org-structure-template-alist
'("b" "#+begin_src shell :results output :exports both\n\n#+end_src" "\n\n"))
diff --git a/module2/ressources/rr_org/init.org b/module2/ressources/rr_org/init.org
index e1877bee77b4bcb940c5789b6642c608b881ed42..a87255478113cd740d234e1f6392ccf1ad850f54 100644
--- a/module2/ressources/rr_org/init.org
+++ b/module2/ressources/rr_org/init.org
@@ -281,6 +281,11 @@ Additional shortcuts for navigating through org-mode documents:
(setq org-src-preserve-indentation t)
#+end_src
+** Python
+*** We use python3
+#+begin_src emacs-lisp :tangle init.el
+(setq org-babel-python-command "python3")
+#+end_src
** Adding source code blocks: :LUKA:
*** With capital letters:
To use this type \n\n"))
+ '("P" "#+begin_src python :results output :session :exports both\n\n#+end_src" "\n\n"))
#+end_src
#+begin_src emacs-lisp :tangle init.el
(add-to-list 'org-structure-template-alist
- '("PP" "#+begin_src python :results file :var matplot_lib_filename=(org-babel-temp-file \"figure\" \".png\") :exports both \nimport matplotlib.pyplot as plt\n\nimport numpy\nx=numpy.linspace(-15,15)\nplt.figure(figsize=(10,5))\nplt.plot(x,numpy.cos(x)/x)\nplt.tight_layout()\n\nplt.savefig(matplot_lib_filename)\nreturn(matplot_lib_filename)\n#+end_src" "\n\n"))
+ '("PP" "#+begin_src python :results output file :session :var matplot_lib_filename=(org-babel-temp-file \"figure\" \".png\") :exports both\nimport matplotlib.pyplot as plt\n\nimport numpy\nx=numpy.linspace(-15,15)\nplt.figure(figsize=(10,5))\nplt.plot(x,numpy.cos(x)/x)\nplt.tight_layout()\n\nplt.savefig(matplot_lib_filename)\nprint(matplot_lib_filename)\n#+end_src" "\n\n"))
#+end_src
*** Bash "sh" code:
To use this type