I have a python source block in org mode as below

#+BEGIN_SRC python :session
  print('hello world')

and I have a Python shell already run, so when i press C-c C-c, the code gets evaluated by the Python shell. Below is what I have in the Python shell:

In [12]: print('hello world')
hello world

In [13]: open('/var/folders/y1/197_jjzs1yv2qz0m26z1jkxw0000gn/T/babel- 
2T9E0c/python-zCCqcO', 'w').write(str(_))

In [13]: 
Out[13]: 20

In [14]: 
In [14]: 
In [14]: Out[14]: 'org_babel_python_eoe'

why there are so many extra lines output? and how can I avoid them?

I am using spacemacs with emacs v26.1 with elpy on a Macbook.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.