[Tutor] interacting with shell
Paul Tremblay
phthenry@earthlink.net
Fri, 19 Apr 2002 15:57:37 -0400
On Thu, Apr 18, 2002 at 08:41:32PM -0700, Danny Yoo wrote:
>
> Not in the way we'd expect, since os.system() returns the "errorlevel" or
> exit code of the command we execute. However, there's a separate
> process-spawning function called os.popen() that's more like what you're
> looking for:
>
[snip]
Thanks everyone! I don't care that it takes a few more lines of code. I
need to re-write this backup script, and rather than use perl, I
figure I should use python, which I am just learning.
I have checked out a book called *The Quick Python book* from the
library, and for some reason it didn't give very much information
on interacting with the shell.
So far, I am really bowled over with python. It is easier to
understand than perl, it is cleaner, and it is object oriented.
This means my code will be easier to maintain. I want to parse
xml and have looked at several tutorials on doing it in perl,
and still can't quite figure it out. I have also looked at
several tutorials on python, and even though I know hardly any
python, I could pretty much understand them right off.
I'm not trying to bash perl; it is a very powerful language.
However, it seems at this point that if I had just one language
to learn, it would be python.
Paul
--
************************
*Paul Tremblay *
*phthenry@earthlink.net*
************************