I open emacs with ~emacs -Q~ #+BEGIN_SRC emacs-lisp :results none (org-babel-do-load-languages 'org-babel-load-languages '((python . t) (emacs-lisp . t) (org . t))) #+END_SRC * This block works all the time #+BEGIN_SRC python :python python3 :session import numpy as np for i in [1, 2, 3]: a = i print(a) a #+END_SRC #+RESULTS: : 3 * My Python 3 block: #+BEGIN_SRC python :python python3 :session import numpy as np for i in [1, 2, 3]: # Comment a = i print(a) a #+END_SRC #+RESULTS: * What happens with C-c C-c: If I do C-c C-c in the block, I get this in the *Python* buffer: #+BEGIN_EXAMPLE >>> import numpy as np >>> for i in [1, 2, 3]: ... # Comment ... File "", line 3 ^ IndentationError: expected an indented block a = i >>> File "", line 1 a = i ^ IndentationError: unexpected indent >>> print(a) >>> Traceback (most recent call last): File "", line 1, in NameError: name 'a' is not defined >>> open('/tmp/babel-112622VJ/python-112621jw', 'w').write(str(_)) >>> 20 >>> >>> 'org_babel_python_eoe' >>> 'org_babel_python_eoe' >>> #+END_EXAMPLE * What happens with C-c C-v v C-c C-c If I do C-c C-v v C-c C-c in the block, I get this in the *Python* buffer #+BEGIN_EXAMPLE >>> 3 >>> #+END_EXAMPLE * What happens with C-c ' C-c C-c If I do C-c ' C-c C-c in the block, I get this in the *Python* buffer #+BEGIN_EXAMPLE >>> 3 >>> #+END_EXAMPLE * Question: 1. Is this the expected behaviour? 2. Is there a way to get ~#+RESULTS:~ with C-c C-c directly for this kind of blocks?