call shell from python

spilcm at hotmail.com spilcm at hotmail.com
Tue Feb 12 11:30:04 CET 2013


On Tuesday, February 12, 2013 6:13:38 AM UTC+1, contro opinion wrote:
> >>> import os
> >>> os.system("i=3")
> 0
> >>> os.system("echo $i")
> 
> 
> 0
> how can i get the value of  i?

You may want to take a look at the pexcpect module : http://www.noah.org/wiki/pexpect



More information about the Python-list mailing list