Possible Duplicate:
Pipe subprocess standard output to a variable
I am running a python program :
import os
os.system("ls") # ls command runs on the terminal
To store the output in a file :
os.system("ls > a.txt")
What I need is, it stores the output in some temporary string . IS THAT POSSIBLE ??