Skip to content

Update #23998

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Update #23998

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions Tools/scripts/google.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@ def quote(arg):
arg = '"%s"' % arg
return urllib.parse.quote_plus(arg)

qstring = '+'.join(quote(arg) for arg in args)
qstring = '%20'.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:])
if len(sys.argv)>1:
main(sys.argv[1:])
else:
print("Enter what you want to search in Google\n"+
"example : google.py python")
sys.exit(1)