简体   繁体   中英

How to export only the python output not source code to ODT from emacs org-mode?

I have python source code in emacs org-mode. I only want to export the output of python code to the ODT not the source code. How could I do that?

Here is my test code. When I do the export, only the source code in my ODT file.

#+BEGIN_SRC python :results output :export result
  import pprint

  test_dict = {
      'a':1,
      'b':2,
      'c':3,
      "nested": {
          "n_a":1,
          "n_b":2,
          "n_c":3
      }
  }

  pprint.pprint(test_dict, indent=2, width=1)
#+END_SRC

#+RESULTS:
: { 'a': 1,
:   'b': 2,
:   'c': 3,
:   'nested': { 'n_a': 1,
:               'n_b': 2,
:               'n_c': 3}}

You will need to set :exports header to results . Here is a link to the org-mode describing the header.

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