python program
how to make a program in python to search anything in browser ?
code:
while 1:import sys
import urllib.parse
import webbrowser
x=input("search here : ")
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(x, '?q=' + qstring)
webbrowser.open(url)
if __name__ == '__main__':
main(sys.argv[1:])
No comments:
Post a Comment