首页 > 解决方案 > 使用 Python 和 REST api 从 Sharepoint 中提取

问题描述

{0}/{1}in是什么意思http://server/site/{0}/{1}/_api/web/lists/GetByTitle

标签: pythonsharepointrest

解决方案


在这里,大括号字符('花括号')用于指示字符串中的替换字段:

假设你有这个字符串,

my_string = "http://server/site/{0}/{1}/_api/web/lists/GetByTitle"

稍后在代码中,您可以使用字符串格式函数为此替换字段提供值。

>>> my_string.format("first", "second")
'http://server/site/first/second/_api/web/lists/GetByTitle'

这里{0}将被替换为格式函数()的第一个参数,并将被替换为first格式函数( ){1}的第二个参数second


推荐阅读