标签:bsp 图片 open return python python接口 append range 自动化
# 添加多个附件参数化
files = [("1.png", "1.png")
("2.png", "2.png")
]
def addFiles(files, n=1):
file = []
for i in list(range(n)):
a =("files[]", (files[i][1], open(files[i][2], "rb"), "image/png"))
b = ("labels[]", (None, ‘附件标题1‘)),
("files[]", ("2.png", open("d:\\2.png", "rb"), "image/png")),
("labels[]", "tu2"),
file.append(a)
file.append(b)
return file
标签:bsp 图片 open return python python接口 append range 自动化
原文地址:https://www.cnblogs.com/zhongyehai/p/9160252.html