I am a very new to Python so this question might be silly. I am trying to code a script which goes through the directory tree and when it finds a .jpg file it copies the individual words in the filename as a keywords (~tags) into the file. I managed to do this ok but somehow I get dublicate files created. The new files have .jpg~ ending so I assume they are some kind of temp files? According to docs/examples I found from net the save() function should save the IPTCInfo into the same file where it was read. What I do wrong here. My script below. Thanks for info!
for root, dirs, files in os.walk("."):
for name in files:
tags = name[:-4].split()
info = iptcinfo3.IPTCInfo(name, force=True)
for t in tags: