I worked out a code that make sense to me but not python since I’m new to python.
Check my code here:
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
My intention is to search filename in a list like :
['manifest-md5.txt','tagmanifest-md5.txt','manifest-sha1.txt','tagmanifest-sha1.txt']
but I got syntax problem to implement it.
Thanks for any help.
You’re overthinking it.