By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,665 Members | 1,258 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,665 IT Pros & Developers. It's quick & easy.

Python: executing ping and whois

P: n/a
Hi all,

Anybody that could tell me how to execute some Linux commands using
Python.
The application is that I want to be able from a website to launch a
Python script and that python script should be able to ping to the
provided IP address, or should do a whois of that IP address. I want
to use the existing Linux commands if possible.

Anyone has an idea or tutorial?

Thanks,
Jul 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
WIWA wrote:
I want
to use the existing Linux commands if possible.


Checkout os.system or (better) os.popen* functions

--
Lawrence "Rhymes" Oluyede
http://loluyede.blogspot.com
rh****@NOSPAMmyself.com
Jul 18 '05 #2

P: n/a
wi*********@skynet.be (WIWA) writes:
Anybody that could tell me how to execute some Linux commands using
Python.

[...]

os.system, os.popen*, popen2 module. Also

http://pexpect.sourceforge.net/
John
Jul 18 '05 #3

P: n/a
On 20 Aug 2003 14:03:18 -0700, WIWA <wi*********@skynet.be> wrote:
Anybody that could tell me how to execute some Linux commands using
Python.
The application is that I want to be able from a website to launch a
Python script and that python script should be able to ping to the
provided IP address, or should do a whois of that IP address. I want
to use the existing Linux commands if possible.

Anyone has an idea or tutorial?


http://python.org/doc/current/lib/module-commands.html

Should be just what you want.

J.
Jul 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.