Last active
July 18, 2016 03:03
-
-
Save natanielstrack/def9cf131dfb7e5a65e6a7bc705b7d26 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
try: | |
resp =requests.get("https://www.python.org/dev/peps/pep-0020/") | |
if resp.status_code == 200: | |
soup = BeautifulSoup(resp.content, 'html.parser') | |
print soup.pre.string | |
print "(server version)" | |
else: | |
raise Exception, "Zen not found" | |
except Exception: | |
import this | |
print "(local version)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment