看板 Python 關於我們 聯絡資訊
各位大大好! 寫了一支程式打算用來更新google sheet的資料 一直卡在連結google sheet這關 現在的做法是python先跑完資料, 再手動貼上google sheet 步驟如下: 1. 先刪掉原本google sheet的內容, 但條件化格式設定還在 (原本的檔案已經手動設定好每一欄位的格式) 2. 手動貼上新的python跑好的資料(存成excel檔) 我查過有gspread和pygspread可以用, 但一直失敗.. 在python的原始表格是dataframe 請問要怎麼寫才能直接把dataframe更新到google sheet上, 且保留原始檔案的條件化格式? 謝謝!! -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 223.140.171.81 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1611420241.A.B3B.html
Starcraft2: 手動貼感覺有點累啊 你用pygspread遇到什麼錯誤 01/24 03:43
Starcraft2: 找個Google官方的Sheet API或者是網路上別人包好的pkg 01/24 03:44
Starcraft2: https://github.com/aiguofer/gspread-pandas 01/24 03:44
Starcraft2: 應該不會寫得太久 01/24 03:44
ToastBen: Google App Script? 01/24 13:41
chih: gspread+ServiceAccountCredentials 01/24 21:54
chih: 我是參考 https://ithelp.ithome.com.tw/articles/10212925 01/24 21:56
Brahms5566: 謝謝各位, 我再試試看! 01/24 23:19