Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Python: executing ping and whois (http://www.velocityreviews.com/forums/t321259-python-executing-ping-and-whois.html)

WIWA 08-20-2003 09:03 PM

Python: executing ping and whois
 
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,

Lawrence Oluyede 08-20-2003 09:34 PM

Re: Python: executing ping and whois
 
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
rhymes@NOSPAMmyself.com

John J. Lee 08-20-2003 10:27 PM

Re: Python: executing ping and whois
 
wim_wauters@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

Jordan Krushen 08-20-2003 11:06 PM

Re: Python: executing ping and whois
 
On 20 Aug 2003 14:03:18 -0700, WIWA <wim_wauters@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.


All times are GMT. The time now is 04:42 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.