5

I tried now for one hour and I don't get the result I expect, so I need to ask you here:

  • I have Emacs 24 installed
  • I have Python 3.0 installed

Actually I try to parse a python output to a table via orgmode:

#+begin_src python :session :results output table :exports results
print("|Example|")
print("|--------|")
print("|One example entry|")
#+end_src

I expect a table when I export the buffer to pdf/html.

However this does not happen.

Can anyone fix my code and tell me, why mine does not work?

Thanks in advance!

3
  • "However this does not happen." Okay, what does happen? Commented Aug 10, 2015 at 14:42
  • Oh. Sorry - I actually see what python writes to the output stream so: |Example| |-----------| |One example entry| But it is not parsed to a table Commented Aug 10, 2015 at 14:54
  • There is an example here of how to output an org-mode table by returning a list of lists -- no print('|------|') necessary. Commented Jan 15, 2019 at 16:20

1 Answer 1

4

Add raw to your :results header arguments:

#+begin_src python :session :results output table raw :exports results
print("|Example|")
print("|--------|")
print("|One example entry|")
#+end_src

From the documentation:

raw The results are interpreted as raw Org mode code and are inserted directly into the buffer. If the results look like a table they will be aligned as such by Org mode.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.