For tangling: you could put from __future__ imports into the :shebang and use padline ":padline no", i.e.:#+source: the_test#+begin_src python :var x=3 :tangle test.py :results output :shebang from __future__ imports :padline noprint x#+end_srcwhich results infrom __future__ importsprint xKeep in mind, that I have NEVER used python (although I should…).
A second problem I have at the moment lies with the execution of source-blocks in tables. What I'd like to do:
| argument | result |
| 1 | #ERROR |
| | |
#+TBLFM: $2=call_the_test(x=$<)
I guess I'm just doing something wrong here. Executing the #+Tblfm results in the error: "reference $< not found in buffer". How do I do the reference correctly in this case?
You can test both cases in the attached org-file.