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
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