Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -37,10 +37,10 @@ st.markdown("""
|
|
| 37 |
# ===== GSheet integration =====
|
| 38 |
@st.cache_resource
|
| 39 |
def get_gsheet_client():
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
|
| 45 |
# ===== Save to Google Sheets =====
|
| 46 |
def save_to_gsheet(name, student_id, major, prediction, semester_data, sheet_name="Trang tính1"):
|
|
|
|
| 37 |
# ===== GSheet integration =====
|
| 38 |
@st.cache_resource
|
| 39 |
def get_gsheet_client():
|
| 40 |
+
scope = ["https://spreadsheets.google.com/feeds", "https://www.googleapis.com/auth/drive"]
|
| 41 |
+
creds = ServiceAccountCredentials.from_json_keyfile_name("credentials.json", scope)
|
| 42 |
+
client = gspread.authorize(creds)
|
| 43 |
+
return client
|
| 44 |
|
| 45 |
# ===== Save to Google Sheets =====
|
| 46 |
def save_to_gsheet(name, student_id, major, prediction, semester_data, sheet_name="Trang tính1"):
|