emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] setting flags in python src blocks?


From: John Kitchin
Subject: Re: [O] setting flags in python src blocks?
Date: Wed, 31 Jan 2018 22:23:32 -0800

Thanks. That does work for flags the interpreter knows, but python doesn't understand --some_flag (I mean literally that flag!).

It turns out I meant:

python test.py --some_flag=True.

It looks like that is not currently possible.

John

-----------------------------------
Professor John Kitchin 
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803

On Wed, Jan 31, 2018 at 10:11 PM, Yasushi SHOJI <address@hidden> wrote:
Hi,

On Thu, Feb 1, 2018 at 8:47 AM, John Kitchin <address@hidden> wrote:
> 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

ob-python doesn't suport :flags nor :cmdline, but you can set interpreter
with :python. So, you can do

#+begin_src python :python "python --some_flag=True"

to pass parameter to the interpreter.
--
           yashi


reply via email to

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