简体   繁体   中英

Parse Python Output in OrgMode to a table

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!

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM