-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPrintGspread.py
More file actions
32 lines (26 loc) · 869 Bytes
/
PrintGspread.py
File metadata and controls
32 lines (26 loc) · 869 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import json
import gspread
from oauth2client.client import SignedJwtAssertionCredentials
from flask import Flask, render_template
json_key = json.load(open('spreadsheet_credentials.json'))
scope = ['https://spreadsheets.google.com/feeds']
credentials = SignedJwtAssertionCredentials(json_key['client_email'], json_key['private_key'], scope)
gc = gspread.authorize(credentials)
#worksheet = wsh.sheet1 <-- this isnt needed
wsh = gc.open("Simple Sheet")
worksheet = wsh.sheet1
dessert_list = worksheet.col_values(2)
heroes_list = worksheet.col_values(1)
name = heroes_list[0]
dessert = dessert_list[0]
print name, dessert
#mytable = worksheet.get_all_values()
#print mytable
global i, j
i = 0
for row in worksheet.get_all_values():
i = i + 1
#print str(i) + " " + "row"
j = 0
if row[0] == 'Red Guardian':
print row[0] + " loves " + row[0]