Re: Testing for connection to a website

2008-07-17 Thread Venky Shankar
;t think so, you guys are smarter than > that. > > So, how can I test for connection to a website. > > -- > > View this message in context: > http://www.nabble.com/Testing-for-connection-to-a-website-tp18473382p... > > Sent from the Python - python-list mailing list arch

Re: Testing for connection to a website

2008-07-16 Thread Alexnb
print "good to go" > > > > -- > http://mail.python.org/mailman/listinfo/python-list > > Thanks! can't believe I didn't think of that. -- View this message in context: http://www.nabble.com/Testing-for-connection-to-a-website-tp18473382p18493785.html Sent from the Python - python-list mailing list archive at Nabble.com. -- http://mail.python.org/mailman/listinfo/python-list

Re: Testing for connection to a website

2008-07-16 Thread Fredrik Lundh
Alexnb wrote: e = '' try: ... except HTTPError, e: print e.code except URLError, e: print e.reason if e == '': print "good to go" footnote: here's a better way to test if an exception was raised or not: try: ... except HTTPError, e: print e.co

Re: Testing for connection to a website

2008-07-15 Thread Alexnb
;> e = '' >> >> req = urllib2.Request('http://www.dictionary.com') >> try: >>response = urlopen(req) >> >> except HTTPError, e: >>print e.code >> except URLError, e: >>print e.reason >> >> if e == '&#x

Re: Testing for connection to a website

2008-07-15 Thread Timothy Grant
pen(req) > > except HTTPError, e: >print e.code > except URLError, e: > print e.reason > > if e == '': >print "good to go" > -- > View this message in context: > http://www.nabble.com/Testing-for-connection-to-a-website-tp18473382p18476597

Re: Testing for connection to a website

2008-07-15 Thread Alexnb
lib2 e = '' req = urllib2.Request('http://www.dictionary.com') try: response = urlopen(req) except HTTPError, e: print e.code except URLError, e: print e.reason if e == '': print "good to go" -- View this message in context: http://w

Re: Testing for connection to a website

2008-07-15 Thread Larry Bates
Alexnb wrote: Okay, I already made this post, but it kinda got lost. So anyway I need to figure out how to test if the user is able to connect to a specific website. Last time I got pointed to the urllib2 page, but if I do urlopen() and and am not connected, the program stops. So I don't know if

Re: Testing for connection to a website

2008-07-15 Thread Grant Edwards
On 2008-07-15, Alexnb <[EMAIL PROTECTED]> wrote: > Okay, I already made this post, but it kinda got lost. No, it didn't get lost. Your question was answered and you didn't like the answer. > So anyway I need to figure out how to test if the user is able > to connect to a specific website. Last

Re: Testing for connection to a website

2008-07-15 Thread Jordan
nd and > am not connected, the program stops. So I don't know if that was what you > guys wanted me to do, but I don't think so, you guys are smarter than that. > So, how can I test for connection to a website. > -- > View this message in > context:http://www.nab

Testing for connection to a website

2008-07-15 Thread Alexnb
what you guys wanted me to do, but I don't think so, you guys are smarter than that. So, how can I test for connection to a website. -- View this message in context: http://www.nabble.com/Testing-for-connection-to-a-website-tp18473382p18473382.html Sent from the Python - python-list ma