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


Groups > comp.lang.python > #72194

Re: passing Python assignment value to shell

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!newsfeed-00.mathworks.com!panix!gordon
From John Gordon <gordon@panix.com>
Newsgroups comp.lang.python
Subject Re: passing Python assignment value to shell
Date Wed, 28 May 2014 21:40:14 +0000 (UTC)
Organization PANIX Public Access Internet and UNIX, NYC
Lines 22
Message-ID <lm5l3u$djm$1@reader1.panix.com> (permalink)
References <mailman.10422.1401310723.18130.python-list@python.org>
NNTP-Posting-Host panix1.panix.com
X-Trace reader1.panix.com 1401313214 13942 166.84.1.1 (28 May 2014 21:40:14 GMT)
X-Complaints-To abuse@panix.com
NNTP-Posting-Date Wed, 28 May 2014 21:40:14 +0000 (UTC)
User-Agent nn/6.7.3
Xref csiph.com comp.lang.python:72194

Show key headers only | View raw


In <mailman.10422.1401310723.18130.python-list@python.org> Satish Muthali <satish.muthali@gmail.com> writes:

> Now I want to feed the value for 'freecalc_total' as an argument to
> a command executed by the shell.

> For example:

> devnull = open(os.devnull, 'w')
> runCommand = subprocess.call(['stressapptest', '<I want to pass
> the value of freecalc_total here>'], stdout=devnull,stderr=subprocess.STDOUT)
> devnull.close()

I think you can just include freecalc_total directly as part of the
argument list, like this:

    runCommand = subprocess.call(['stressapptest', freecalc_total], 
        stdout=devnull, stderr=subprocess.STDOUT)

-- 
John Gordon         Imagine what it must be like for a real medical doctor to
gordon@panix.com    watch 'House', or a real serial killer to watch 'Dexter'.

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


Thread

passing Python assignment value to shell Satish Muthali <satish.muthali@gmail.com> - 2014-05-28 13:16 -0700
  Re: passing Python assignment value to shell John Gordon <gordon@panix.com> - 2014-05-28 21:40 +0000

csiph-web