【发布时间】:2021-06-20 16:39:27
【问题描述】:
我有这行:
assert response.headers['Content-Disposition'] == 'attachment; filename=myFile.txt'
在该行的第二个字符串中 ('attachment; filename=myFile.txt')
我想删除硬编码的文件名 (myFile.txt) 并将其替换为我拥有的变量。
就像 C 中的 printf(),在某种程度上,用变量替换了那个确切位置的字符串。
【问题讨论】:
标签: python