Back to index

python3.2  3.2.2
Functions
google Namespace Reference

Functions

def main

Function Documentation

def google.main ( void  )

Definition at line 5 of file google.py.

00005 
00006 def main():
00007     args = sys.argv[1:]
00008     if not args:
00009         print("Usage: %s querystring" % sys.argv[0])
00010         return
00011     list = []
00012     for arg in args:
00013         if '+' in arg:
00014             arg = arg.replace('+', '%2B')
00015         if ' ' in arg:
00016             arg = '"%s"' % arg
00017         arg = arg.replace(' ', '+')
00018         list.append(arg)
00019     s = '+'.join(list)
00020     url = "http://www.google.com/search?q=%s" % s
00021     webbrowser.open(url)

Here is the call graph for this function: