Script for opening up a Google search in a browser

python

Solution

Opening a webpage is pretty simple in Python.

import webbrowser
url = "https://www.google.com.tr/search?q={}".format(search_term)    
webbrowser.open(url)

For a little more reliability, you can pass search_term to `urlencode` first.

Problem

I'm a programming novice whose experience is limited to writing very simple programs in Python. For part of my first 'real' project I'd like to write a script that takes an input and opens up a browser window with a Google search for that input. I'm at sea on how to accomplish this; I've fiddled around with variations on scripts like this, but this outputs the results by printing it to the console; for my purposes, I'd like the output to actually open a window with the search results for the query (ultimately I'd also like the script to take screenshot of the browser window and paste it to a Word document, but one thing at a time).

Original source