From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: setting flags in python src blocks? Date: Wed, 31 Jan 2018 15:47:03 -0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a1148d714a6f25605641b18ce" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54862) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eh25r-00083H-B7 for emacs-orgmode@gnu.org; Wed, 31 Jan 2018 18:47:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eh25q-0005Qz-AJ for emacs-orgmode@gnu.org; Wed, 31 Jan 2018 18:47:07 -0500 Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]:37754) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eh25q-0005QG-3Z for emacs-orgmode@gnu.org; Wed, 31 Jan 2018 18:47:06 -0500 Received: by mail-wm0-x22a.google.com with SMTP id v71so2322218wmv.2 for ; Wed, 31 Jan 2018 15:47:05 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: org-mode-email --001a1148d714a6f25605641b18ce Content-Type: text/plain; charset="UTF-8" Is it possible to set command line flags for an executable in src blocks? I was thinking of something like this #+BEGIN_SRC python :flags --some_flag=True :tangle test.py import app print(app.FLAGS.some_flag) # -> True #+END_SRC which would be equivalent to running: > python --some_flag=True test.py Thanks, John ----------------------------------- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu --001a1148d714a6f25605641b18ce Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Is it possible to set command line flags for an executable= in src blocks? I was thinking of something like this=C2=A0

<= div>
#+BEGIN_SRC python :flags --some_flag=3DTrue :tangle test.py
=
import app

print(app.FLAGS.some_flag) # ->= True
#+END_SRC

which would be equivalen= t to running:

> python --some_flag=3DTrue test.= py

Thanks,

John

-------= ----------------------------
Professor John Kitchin=C2=A0
Doherty Hal= l A207F
Department of Chemical Engineering
Carnegie Mellon University=
Pittsburgh, PA 15213
412-268-7803
--001a1148d714a6f25605641b18ce--