emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Need control over insertion point of variables in code blocks


From: Rainer M Krug
Subject: Re: [O] Need control over insertion point of variables in code blocks
Date: Fri, 22 Jul 2011 10:02:55 +0200



On Fri, Jul 22, 2011 at 9:55 AM, Dirk Scharff <address@hidden> wrote:
Hi

Am 22.07.2011 um 09:34 schrieb Rainer M Krug:

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 no
print x
#+end_src

which results in

from __future__ imports
print x

Keep in mind, that I have NEVER used python (although I should…).

While I'd not call that a clean solution to the problem it will keep me going for now. 

Agreed - but it works. Good.
  

Thank you very much for pointing that possibility out, I haven't thought about trying to move the import statement. 

As for python: its a nice language worth trying in my opinion ;)  

Sounds like it - I just need time.....

Cheers and good luck with your thesis,

Rainer
 


With this i could do the table calculation manually by inserting 100-1000 call statements (in the real use case I need for my masters-thesis) but it would be really nice if i could use a table cell as argument for code-blocks. 

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.


best regards,
Dirk



--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax (F):       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      address@hidden

Skype:      RMkrug


reply via email to

[Prev in Thread] Current Thread [Next in Thread]