command substitution

Daniel Dittmar daniel.dittmar at sap.com
Mon Jul 16 06:18:30 EDT 2001


> I was looking for a solution like in bash, which let you put the standard
> output of a command in a variable(in bash, you can do it like OUT=`ls` or
> OUT=$(ls) ).

import commands
var = commands.getoutput ('ls')

Daniel






More information about the Python-list mailing list