【发布时间】:2020-10-10 05:47:55
【问题描述】:
我想获取教师在 Google 课堂的特定课程中发布的每项作业的作业标题。有人可以帮我弄这个吗?当我在官方网站上尝试 API Explorer 时,它返回了正确的结果,但它不适用于我的 python 文件。
service = build('classroom', 'v1', credentials=creds)
# Call the Classroom API
results = service.courses().courseWork().get(courseId).execute()
courses = results.get('courses')
if not courses:
print('No courses found.')
else:
print('Courses:')
for course in courses:
print(course)
【问题讨论】:
-
我猜你的意思是使用
list而不是get?
标签: python python-3.x google-classroom