Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #30673

Re: parse an environment file

References (1 earlier) <CANy1k1g1dt6GQR80LWMkBt+YXzZXxtkUSV=qamWsS8mZXiyaAA@mail.gmail.com> <CAPTjJmrcsPgtcy6Aa5KJ8mRjFuB5b-FBanVQJ1o0M_PnHVpL2w@mail.gmail.com> <CANy1k1hzHqODvV7Eu64maOfCx8Os48wro56HG=uheyjqUos-uQ@mail.gmail.com> <CAPTjJmq2p5FLq8_w35qguoBhckBTdohb419j_jCWuvTP9vjKog@mail.gmail.com> <CANy1k1ifxed+V8v=sG+hU+-TXd+xzo8B0VBcGydardmGLtZNyw@mail.gmail.com>
Date 2012-10-03 14:03 +1000
Subject Re: parse an environment file
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1753.1349237042.27098.python-list@python.org> (permalink)

Show all headers | View raw


On Wed, Oct 3, 2012 at 1:49 PM, Jason Friedman <jason@powerpull.net> wrote:
> Based on your responses and everyone's responses I'm guessing that
> what I am doing is sufficiently novel that there is no canned
> solution.  I looked at shlex but did not see how that would be
> helpful.

The only canned solution for parsing a bash script is bash. Think
about it the other way around: If you wanted to have a Python variable
made available to a bash script, the obvious thing to do is to invoke
Python. It's the same thing.

I recommend going with Hans Mulder's suggestion of a wrapper script;
that seems to be the cleanest option available.

ChrisA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: parse an environment file Chris Angelico <rosuav@gmail.com> - 2012-10-03 14:03 +1000

csiph-web