Dec-19-2017, 07:08 PM
Hello and thanks for reading. Here is what I have so far:
thing inside of it) and then encode it to the google search url. (The random stuff in mydict is just a placeholder).
Also, I then do not know how to have it open chrome and paste the URL into the search to open it automatically.
I found out that the Unix binary, located at /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome, can open URLs without launching a new browser instance. I just do not know how to make it open.
Any help is massively appreciated, I am a beginner and am learning the ropes.
Thanks!
from urllib.request import urlretrieve from urllib.parse import urlencode mydict = {'q': 'whee! Stanford!!!', 'something': 'else'} qstr = urlencode(mydict) # str resolves to: 'q=whee%21+Stanford%21%21%21&something=else' thing = urlretrieve("https://www.google.com/search?" + qstr)I have a text document (named OCR.txt specifically). I want to take the question that is in it (that is the only
thing inside of it) and then encode it to the google search url. (The random stuff in mydict is just a placeholder).
Also, I then do not know how to have it open chrome and paste the URL into the search to open it automatically.
I found out that the Unix binary, located at /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome, can open URLs without launching a new browser instance. I just do not know how to make it open.
Any help is massively appreciated, I am a beginner and am learning the ropes.
Thanks!