emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Charles C. Berry" <ccberry@ucsd.edu>
To: Piter <x.piter@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: passing entry property to a source code block?
Date: Fri, 2 Dec 2016 08:47:32 -0800	[thread overview]
Message-ID: <alpine.OSX.2.20.1612020843330.699@charles-berrys-macbook.local> (raw)
In-Reply-To: <dfcca66d-910b-8449-f560-252fc2f15c61@gmail.com>

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

      reply	other threads:[~2016-12-02 16:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-02 11:03 passing entry property to a source code block? Piter
2016-12-02 16:47 ` Charles C. Berry [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.OSX.2.20.1612020843330.699@charles-berrys-macbook.local \
    --to=ccberry@ucsd.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=x.piter@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).