Revision 000b9e803a7ec067da0a43f9a3fec16f1078215a authored by Miss Islington (bot) on 03 July 2021, 20:51:10 UTC, committed by GitHub on 03 July 2021, 20:51:10 UTC
(cherry picked from commit bc3961485639cc73de7c4c7eed1b56f3c74939bf) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com> Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
1 parent bea618d
google.py
#! /usr/bin/env python3
"""Script to search with Google
Usage:
python3 google.py [search terms]
"""
import sys
import urllib.parse
import webbrowser
def main(args):
def quote(arg):
if ' ' in arg:
arg = '"%s"' % arg
return urllib.parse.quote_plus(arg)
qstring = '+'.join(quote(arg) for arg in args)
url = urllib.parse.urljoin('https://www.google.com/search', '?q=' + qstring)
webbrowser.open(url)
if __name__ == '__main__':
main(sys.argv[1:])
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...