From 739a8a96b29fe2703c08f64e4cbf8bd4fc3ff0d7 Mon Sep 17 00:00:00 2001 From: MR HK <61715829+HSNHK@users.noreply.github.com> Date: Tue, 29 Dec 2020 17:52:21 +0330 Subject: [PATCH] Update google.py 1.How to use added 2.The distance between Google URLs is as follows: 20% --- Tools/scripts/google.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Tools/scripts/google.py b/Tools/scripts/google.py index 82fb2871885d03..be353d98057af1 100755 --- a/Tools/scripts/google.py +++ b/Tools/scripts/google.py @@ -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)