DeaD_EyE

cheat.sh

May 2nd, 2019
131
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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')
RAW Paste Data