7
tôi đã quản lý để tạo ra một bảng tính doc mới sử dụng đoạn mã sau:Tạo bảng tính mới (Google API/Python)
# Authorize
client = gdata.docs.client.DocsClient(source='TestDoc')
client.http_client.debug = False
client.client_login(self.cfg.get('google', 'email'), self.cfg.get('google', 'password'), source='TestDoc', service='writely')
# Create our doc
document = gdata.docs.data.Resource(type='spreadsheet', title='Test Report')
document = client.CreateResource(document)
Đó là sự hiểu biết của tôi là bạn phải xác thực với dịch vụ bảng để thao tác bảng tính.
# Connect to spreadsheet API
client = gdata.spreadsheet.service.SpreadsheetsService()
client.email = self.cfg.get('google', 'email')
client.password = self.cfg.get('google', 'password')
client.source = 'TestDoc'
client.ProgrammaticLogin()
Câu hỏi của tôi là làm cách nào để lấy khóa bảng tính từ bước tạo đầu tiên ở trên để truy cập bảng tính đó bằng gdata.spreadsheet api?
Tôi cũng đang tìm cách tạo bảng tính và sử dụng mã của bạn, tôi không thể đạt được. –