symbian-qemu-0.9.1-12/python-win32-2.6.1/Tools/Scripts/google.py
author asimpson@symbian.org
Thu, 15 Oct 2009 17:58:46 +0100
changeset 14 e6ebb7730c4b
parent 1 2fb8b9db1c86
permissions -rw-r--r--
Added tag PDK_2.0.0 for changeset 52c9f17ec5d1

#! /usr/bin/env python

import sys, webbrowser

def main():
    args = sys.argv[1:]
    if not args:
        print "Usage: %s querystring" % sys.argv[0]
        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)
    url = "http://www.google.com/search?q=%s" % s
    webbrowser.open(url)

if __name__ == '__main__':
    main()