python - 使用 Python 和 REST api 从 Sharepoint 中提取
问题描述
{0}/{1}
in是什么意思http://server/site/{0}/{1}/_api/web/lists/GetByTitle
解决方案
在这里,大括号字符('花括号')用于指示字符串中的替换字段:
假设你有这个字符串,
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
推荐阅读
- ajax - Shopify AJAX - 更新订单项的总价
- sql - 识别字符串中最后一次出现的子字符串,其中子字符串来自表。太极数据
- java - 在不使用解析的情况下在Java中将String转换为Double?
- mysql - MySQL中的奇怪顺序:字段A的顺序加上字段B的重复状态
- r - 从磁盘加载 data.table 时,函数中的 data.table 分配失败
- sql - 什么是表示多个链接在一起的对象的 SQL Server 数据结构?
- javascript - 如何将参数传递给 Highcharts pointFormatter 回调函数
- ios - DJI Mobile sdk - 从 DJI GO App 到个人 App 的遥测
- python - 具有祖先的 Google 数据存储顺序
- php - 用PHP中的空格替换两个html标签之间的所有字符