Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from urllib.request import urlopen, Request
- def cheat(*keywords):
- parts = map(lambda s: s.lower(), keywords)
- url = 'http://cheat.sh/' + '/'.join(parts)
- req = Request(url, headers={'User-Agent': 'curl'})
- print(url)
- print(urlopen(req).read().decode())
- cheat('python', 'lists', 'sort')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement