因为我是python新手,所以我编写了一个对我有意义但对python没有意义的代码。你知道吗
请在此处检查我的代码:
checksum_algos = ['md5','sha1']
for filename in ["%smanifest-%s.txt" % (prefix for prefix in ['', 'tag'], a for a in checksum_algos)]:
f = os.path.join(self.path, filename)
if isfile(f):
yield f
我的目的是在如下列表中搜索文件名:
['manifest-md5.txt','tagmanifest-md5.txt','manifest-sha1.txt','tagmanifest-sha1.txt']
但我在实现它时遇到了syntax
问题。你知道吗
谢谢你的帮助。你知道吗
你想得太多了。你知道吗
或者你需要^{} :
使用新样式字符串格式和
itertools
:输出:
相关问题 更多 >
编程相关推荐