Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #61559 > unrolled thread

Re: Script Request

Started byLarry Martell <larry.martell@gmail.com>
First post2013-12-11 07:16 -0500
Last post2013-12-11 07:16 -0500
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Script Request Larry Martell <larry.martell@gmail.com> - 2013-12-11 07:16 -0500

#61559 — Re: Script Request

FromLarry Martell <larry.martell@gmail.com>
Date2013-12-11 07:16 -0500
SubjectRe: Script Request
Message-ID<mailman.3892.1386764201.18130.python-list@python.org>
On Wed, Dec 11, 2013 at 6:53 AM, Jeff James <jeff@jeffljames.com> wrote:
> Looking for a script which will check connectivity of any or all of our
> company URL's first thing in the morning to make sure none or our sites are
> down.     Any suggestions ?   Thank You

import urllib

sites = ["http://www.amazon.com/", "http://nowhere.com"]

for site in sites:
    try:
        urllib.urlopen(site)
        print site + " is up"
    except Exception, e:
        print site + " is down"

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web