Advertisement
DeaD_EyE

cheat.sh

May 2nd, 2019
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. from urllib.request import urlopen, Request
  2.  
  3.  
  4. def cheat(*keywords):
  5.     parts = map(lambda s: s.lower(), keywords)
  6.     url = 'http://cheat.sh/' + '/'.join(parts)
  7.     req = Request(url, headers={'User-Agent': 'curl'})
  8.     print(url)
  9.     print(urlopen(req).read().decode())
  10.  
  11. cheat('python', 'lists', 'sort')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement