[Tutor] Help with ping...

Rob Andrews rob@uselesspython.com
Tue Nov 12 12:32:02 2002


Here's one way to do it:

#! /usr/bin/python

import os
url = raw_input("please input a domain to ping: ")
pingray = "ping " + url
os.system(pingray)

regards,
Rob

> -----Original Message-----
>
> I want to write something that would just take a url and ping it. Here is
> the code that I have.
>
> #!/usr/bin/python
>
> import os
>
> url = raw_input("Please enter the address you would like to ping:")
>
> print "now pinging %s\n" % url
>
> os.system("ping %s") % url #note I have tried this many different
> ways so I
> know