[sapug] python subprocess.call variable

Garry Trethewey garrytre at bigpond.com
Tue May 25 06:39:58 CEST 2010


In python 2.5, ubuntu 8.04, how can I get a variable to work, instead of 
having to use a string literal, in the following?

I want to do

subprocess.call('scanimage  -args-  > ${outfile}', shell = True)

but I can only do

subprocess.call('scanimage  -args-  > /home/garry/Desktop/junk', shell = 

Everything on the web I've seen is a string literal, not a variable, 
except one instance of $HOME, which kinda doesn't count, because the 
variable already existed before.

I've fiddled for 5 hours, time to ask for help.

Anybody know how do do this?
Garry Trethewey

More information about the sapug mailing list