PageRenderTime 150ms CodeModel.GetById 31ms RepoModel.GetById 0ms app.codeStats 0ms

/Web/search.py

https://github.com/dcbriccetti/python-lessons
Python | 5 lines | 4 code | 1 blank | 0 comment | 0 complexity | 05f6c80d9a6ef9bbb1c61a1104b67339 MD5 | raw file
  1. import requests
  2. search_arg = 'Guido von Rossum'
  3. response = requests.get('https://api.duckduckgo.com/?q=%s&format=json&pretty=1' % search_arg).json()
  4. print('From {}: {}'.format(response['AbstractSource'], response['Abstract']))