Dervin Thunk
Dervin Thunk

Reputation: 20129

How do I prevent results from showing the header of the interactive python shell?

In org-mode, if I execute my first command like this,

#+BEGIN_SRC python :session :results output
t = [1,2,3]
print(t)
#+END_SRC

I obtain

#+RESULTS:
: Python 2.7.12 (default, Jul  1 2016, 15:12:24) 
: [GCC 5.4.0 20160609] on linux2
: Type "help", "copyright", "credits" or "license" for more information.
: >>> python.el: native completion setup loaded
: [1, 2, 3]

How do I simply get:

#+RESULTS:
: [1, 2, 3]

Notice that if I C-c C-c again, the message goes away (sinc ethe process now exists).

Upvotes: 0

Views: 77

Answers (1)

juanleon
juanleon

Reputation: 9380

This is a hack, but it should work:

(setq org-babel-python-command "python -ic ''")

See thread https://mail.python.org/pipermail/python-list/2010-March/569778.html for reason of the "-c ''" weird approach to suppress message.

Upvotes: 1

Related Questions