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 @johnkitchin http://kitchingroup.cheme.cmu.edu On Wed, Jan 31, 2018 at 10:11 PM, Yasushi SHOJI <yasushi.sh...@gmail.com> wrote: > Hi, > > On Thu, Feb 1, 2018 at 8:47 AM, John Kitchin <jkitc...@andrew.cmu.edu> > 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 >