J
John
Can python do Shell programming or system programming as perl does?
Thanks.
John
Thanks.
John
Yes. The only problem is that the perpetual migraine you have fromJohn said:Can python do Shell programming or system programming as perl does?
Thanks.
John
Jeremy Jones said:the toplevel namespace (I don't think Perl has the concept of namespace,
Can python be used for shell programming?
Absolutely. Going through the python tutorial will take, say, 3 hours,
and then you should be able to decide for yourself.
As perl does?
That is a very different question I don't think I am qualified to answer.
James Stroud said:I have done shell programming in both python and perl for some time. I love
both languages for different reasons. At the risk of sounding like language
evangelicalism, though, I will advise you to use python exclusively.
Sometimes without thinking I still reach for perl to do 'shell' scripting (by
thinking in perl and beginning with the infamous "#! /usr/bin/perl -w"). In
these cases I invariably finish and say to myself "I should have done this in
python."
Jeremy Jones said:Yes. The only problem is that the perpetual migraine you have from doing
Perl and shell will quickly go away. So, if you're into pain, stick with
Perl and shell. If you want relief, come to Python.
Seriously, though, Python is an excellent language for doing sysadmin type
tasks. (I'm assuming that's kind of what you wanted?) Most sysadmin type
tasks are in modules whereas with Perl, they're cluttering the toplevel
namespace (I don't think Perl has the concept of namespace, but you get
the drift). So, not knowing what you want to do, you may want to checkout
the os module in Python (I've found os.path.* to be specifically helpful).
You may also want to checkout the shutil module.
Jeremy
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.