Skip to content
This repository was archived by the owner on Nov 12, 2019. It is now read-only.

Commit afdb85b

Browse files
authored
Merge pull request #115 from russfeld/master
Update Google Spreadsheets example
2 parents c9407aa + c7db406 commit afdb85b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/google_spreadsheet.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
def login_open_sheet(oauth_key_file, spreadsheet):
8282
"""Connect to Google Docs spreadsheet and return the first worksheet."""
8383
try:
84-
scope = ['https://spreadsheets.google.com/feeds']
84+
scope = ['https://spreadsheets.google.com/feeds', 'https://www.googleapis.com/auth/drive']
8585
credentials = ServiceAccountCredentials.from_json_keyfile_name(oauth_key_file, scope)
8686
gc = gspread.authorize(credentials)
8787
worksheet = gc.open(spreadsheet).sheet1
@@ -115,7 +115,7 @@ def login_open_sheet(oauth_key_file, spreadsheet):
115115

116116
# Append the data in the spreadsheet, including a timestamp
117117
try:
118-
worksheet.append_row((datetime.datetime.now(), temp, humidity))
118+
worksheet.append_row((datetime.datetime.now().isoformat(), temp, humidity))
119119
except:
120120
# Error appending data, most likely because credentials are stale.
121121
# Null out the worksheet so a login is performed at the top of the loop.

0 commit comments

Comments
 (0)