Jul-11-2017, 06:13 PM
(Jun-25-2017, 09:18 PM)DeaD_EyE Wrote:def is_up(url): try: r = requests.get(url) except ConnectionError: return False if r.status_code == 200: return True else: return False
Improving the improved version! Because extra blocks look like spaghetti to me.
def is_up(url): try: r = requests.get(url) return r.status_code == 200 except ConnectionError: return False