我有2张工作表,需要在团队云端分享。
我阅读了关于pyghsheet的文档,In share pygsheet.share
方法我们可以传递组/用户,但我们如何在teamDrive上共享。
gc= pygsheets.authorize(outh_nonlocal=True)
gc.enableTeamDriveSupport = True
gc.teamDriveId = "xxxxxxxxxxxxx"
print " aurhorization done"
sheet= gc.create("Price-"+oldDate)
sheet.add_worksheet("Sheet2",rows=1000,cols=15)
workSheet=sheet[0]
workSheet.set_dataframe(finalPrice,(1,1))
workSheet=sheet[1]
workSheet.set_dataframe(intermediate,(1,1))
sheet.share(??????)
如何实现。
答案 0 :(得分:1)
如果您想在teamDrive上创建工作表,只需指定要在其中创建工作表的文件夹的ID
gc= pygsheets.authorize(outh_nonlocal=True)
gc.enableTeamDriveSupport = True
gc.teamDriveId = "xxxxxxxxxxxxx"
print " aurhorization done"
sheet= gc.create("Price-"+oldDate, parent_id="xxxxxxxx") # your folder id as parent
sheet.add_worksheet("Sheet2",rows=1000,cols=15)
workSheet=sheet[0]
workSheet.set_dataframe(finalPrice,(1,1))
workSheet=sheet[1]
workSheet.set_dataframe(intermediate,(1,1))