call from pthon to shell
jsf80238 at gmail.com
Sun Feb 17 08:00:23 CET 2013
>>>> import os
>>>> os.system("echo $i")
> 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:
Then, close that terminal and open a new one. You would not be surprised that
$ echo $i
And, as mentioned by Andrew, even absent that problem os.system is not
the way to obtain the data you are looking for.
I realize this is now 5 days after you posted ... what were you
ultimately attempting to accomplish?
More information about the Python-list