emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* passing entry property to a source code block?
@ 2016-12-02 11:03 Piter
  2016-12-02 16:47 ` Charles C. Berry
  0 siblings, 1 reply; 2+ messages in thread
From: Piter @ 2016-12-02 11:03 UTC (permalink / raw)
  To: emacs-orgmode

Hi everybody.

I would like to get a property of org-mode entry and pass it as a string 
variable to a python source code.

Is it possible to do? I have been looking into attach screensshot code 
but since my elisp experience is very limited I can not figure  it out.

Any tips about it? may be I can use inline ellisp function in python 
source header?

Thanks.

Petro

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: passing entry property to a source code block?
  2016-12-02 11:03 passing entry property to a source code block? Piter
@ 2016-12-02 16:47 ` Charles C. Berry
  0 siblings, 0 replies; 2+ messages in thread
From: Charles C. Berry @ 2016-12-02 16:47 UTC (permalink / raw)
  To: Piter; +Cc: emacs-orgmode

On Fri, 2 Dec 2016, Piter wrote:

> Hi everybody.
>
> I would like to get a property of org-mode entry and pass it as a string 
> variable to a python source code.
>
> Is it possible to do? I have been looking into attach screensshot code but 
> since my elisp experience is very limited I can not figure  it out.
>
> Any tips about it? may be I can use inline ellisp function in python source 
> header?
>

That's about right:


# Refresh the `property' line with C-c C-c the first time you use it.

#+PROPERTY: my-string "Hello everyone!"

#+header: :var ms=(org-entry-get (point) "my-string" t)
#+BEGIN_SRC python :results output
print ms
#+END_SRC

#+RESULTS:
: "Hello everyone!"

HTH,

Chuck

p.s. do not forget to

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-12-02 16:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-02 11:03 passing entry property to a source code block? Piter
2016-12-02 16:47 ` Charles C. Berry

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).