0

Emacs 27.050
Windows 10

Hello.

I want to export python code block from my org file to the file.

When executing block there is the following result:

#+BEGIN_SRC python :session  :results output :exports code :file example.py
print ("foo"+ "bar")
#+END_SRC

Here is what is written to the file example.py
==> foobar

How can I export source code to the file?

0

So with the help of @Juancho I have found the answer to this question. It was solved with the help of org-babel-tangle (C-c C-v t), with such header:

#+BEGIN_SRC python :tangle example.py
print ("foo"+ "bar")
#+END_SRC

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.