2001-12-04 11:23:47 -04:00
|
|
|
#! /usr/bin/env python
|
|
|
|
|
|
|
|
import sys, webbrowser
|
|
|
|
|
|
|
|
def main():
|
|
|
|
args = sys.argv[1:]
|
|
|
|
if not args:
|
2007-08-03 14:06:41 -03:00
|
|
|
print("Usage: %s querystring" % sys.argv[0])
|
2001-12-04 11:23:47 -04:00
|
|
|
return
|
|
|
|
list = []
|
|
|
|
for arg in args:
|
|
|
|
if '+' in arg:
|
|
|
|
arg = arg.replace('+', '%2B')
|
|
|
|
if ' ' in arg:
|
|
|
|
arg = '"%s"' % arg
|
|
|
|
arg = arg.replace(' ', '+')
|
|
|
|
list.append(arg)
|
|
|
|
s = '+'.join(list)
|
2002-02-08 12:20:07 -04:00
|
|
|
url = "http://www.google.com/search?q=%s" % s
|
2001-12-04 11:23:47 -04:00
|
|
|
webbrowser.open(url)
|
|
|
|
|
2004-08-09 14:27:55 -03:00
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|