Using command line arguments to launch url in system web browser
Question: I would like to execute a script with parameters, these parameters must be
send into the URL.

So, the main problem, is how to do this task ?

That's my test script to do this, I used sys.argv ...

    
    
    #!/usr/bin/python
    import sys, os
    
    print "The name is :", sys.argv[0]
    print "number of arguments :", len(sys.argv)
    print "arguments are :", str(sys.argv)
    


Answer: The arguments of the script can be accessed via the sys.argv array. For
example:

    
    
    import sys
    
    if len(sys.argv) == 3:
       print "http://www.google.de?q=%s&%s" % (sys.argv[1], sys.argv[2])
    else:
       print "Usage: <Explain params here>"
    

Every argument that is seperated with a space in the command-line can be
accessed via the index in the sys.argv array.

Is this that you were looking for?

EDIT:

If you have a more complex use case where you need a more complex argmument
parser, you can use the
[argparse](https://docs.python.org/2.7/library/argparse.html) module of
python.

