I'm trying to write a script that will write out to Google Docs Spreadsheet and when I run it I get the error in the title. More specifically:
File "/home/pi/Desktop/templog.py", line 44, in <module>
s.run()
File "/usr/lib/python2.7/sched.py", line 117, in run
action(*argument)
File "/home/pi/Desktop/templog.py", line 35, in do_something
entry = spr_client.InsertRow(data_str, spreadsheet_key, worksheet_id)
File "/usr/local/lib/python2.7/dist-packages/gdata/spreadsheet/service.py", line 330, in InsertRow
for k, v in row_data.iteritems():
AttributeError: 'str' object has no attribute 'iteritems'
The piece of code that is causing this is:
entry = spr_client.InsertRow(data_str, spreadsheet_key, worksheet_id)
if isinstance(entry, gdata.spreadsheet.SpreadsheetsList):
No, the line causing the error is row_data.iteritems()
because row_data is a string and the method you're calling is not defined for the class 'str'.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With