subprocess.check_output(('/Applications/googlecl-0.9.13/build/scripts-2.7/google', 'docs', 'get', r'"Reassessment Request"', r'--format', 'csv', r'/Users/myaccount/Desktop'), shell=True)
This code doesn't pull down the doc, but running the identical line will work inside Terminal. It might not be having time to complete? It takes a while when I run it from the command line.
There's a Python error: "Traceback (most recent call last): File "/Users/myaccount/Desktop/reassess2.py", line 17, in subprocess.call('google docs get "Reassessment Request" --format csv /Users/myaccount/Desktop') File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 493, in call return Popen(*popenargs, **kwargs).wait() File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 679, in init errread, errwrite) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1249, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory"
I get a similar problem when I try to run it in an OSX script: When I run the shell script (running the command line above), I get: ?/Users/myaccount/Desktop/ReScript.sh ; exit; .csvloading Reassessment Request to /users/myaccount/Desktop logout
[Process completed]", but no file is actually downloaded.
OSX Mountain Lion; 0.9.13 cl; 2.0.17 gdata (I think - not the most recent, but the one that works with cl)
Thanks for the help!
Google CL is pretty much on its way out, and the new form update to Google drive has broken it for these types of operations. I used Gdata as a workaround for a while, but if anyone is trying to use either of those and stumbles onto this, here's the best current answer: Gspread. It installs easily (unlike the others, which had tricky version compatibility issues), requires less code, and is faster.
With Gspread, this code would be replaced by:
username = 'jimjam@gmail.com'
password = 'bwdfsdfsafadlhsw'
sheetname = "Reassessment Requesttemp"
client = gspread.login(username, password)
spreadsheet = client.open(sheetname)
worksheet = spreadsheet.sheet1
contents = worksheet.get_all_values()