From mboxrd@z Thu Jan  1 00:00:00 1970
From: "Charles C. Berry" <ccberry@ucsd.edu>
Subject: Re: passing entry property to a source code block?
Date: Fri, 2 Dec 2016 08:47:32 -0800
Message-ID: <alpine.OSX.2.20.1612020843330.699@charles-berrys-macbook.local>
References: <dfcca66d-910b-8449-f560-252fc2f15c61@gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII; format=flowed
Return-path: <emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org>
Received: from eggs.gnu.org ([2001:4830:134:3::10]:47022)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <ccberry@ucsd.edu>) id 1cCqzx-00029Y-TA
	for emacs-orgmode@gnu.org; Fri, 02 Dec 2016 11:47:48 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <ccberry@ucsd.edu>) id 1cCqzu-0008Ke-QO
	for emacs-orgmode@gnu.org; Fri, 02 Dec 2016 11:47:45 -0500
Received: from iport-acv5-out.ucsd.edu ([132.239.0.10]:64815)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71)
	(envelope-from <ccberry@ucsd.edu>) id 1cCqzu-0008KK-Dx
	for emacs-orgmode@gnu.org; Fri, 02 Dec 2016 11:47:42 -0500
In-Reply-To: <dfcca66d-910b-8449-f560-252fc2f15c61@gmail.com>
List-Id: "General discussions about Org-mode." <emacs-orgmode.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-orgmode>,
	<mailto:emacs-orgmode-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/emacs-orgmode/>
List-Post: <mailto:emacs-orgmode@gnu.org>
List-Help: <mailto:emacs-orgmode-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-orgmode>,
	<mailto:emacs-orgmode-request@gnu.org?subject=subscribe>
Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org
Sender: "Emacs-orgmode"
	<emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org>
To: Piter <x.piter@gmail.com>
Cc: emacs-orgmode@gnu.org

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