Re: call from pthon to shell

2013-02-16 Thread Jason Friedman
import os os.system("i=3") > 0 os.system("echo $i") > > 0 > > why i can not get the value of i? Each call to os.system starts a new shell. Think about what would happen if you opened a terminal and typed: $ i=3 Then, close that terminal and open a new one. You would not be surpr

Re: call from pthon to shell

2013-02-12 Thread Andrew Robinson
On 02/12/2013 05:38 AM, Bqsj Sjbq wrote: >>> import os >>> os.system("i=3") 0 >>> os.system("echo $i") 0 why i can not get the value of i? First: os.system is only defined to give the return value (exit code) of the sub-process. However, one way to get the output of shell commands is to u