[Tutor] Help with ping...

alan.gauld@bt.com alan.gauld@bt.com
Wed Nov 13 06:57:01 2002


> I want to write something that would just take a url and ping 
> it.

First problem is you don't ping URLs, you ping IP addresses
(either directly or via DNS)

> url = raw_input("Please enter the address you would like to ping:")

But since your prompt asks for an address thats probably OK...

> print "now pinging %s\n" % url
> 
> os.system("ping %s") % url #note I have tried this many 

  os.system("ping %s" % url)  

You want the string substitution inside the system() parameter.

HTH,

Alan g.
Author of the 'Learning to Program' web site
http://www.freenetpages.co.uk/hp/alan.gauld