I need to write a program like this: Write a program that reads a file .picasa.ini and copies pictures in new files, whose names are the same as identification numbers of person on these pictures (eg. 8ff985a43603dbf8.jpg). If there are more person on the picture it makes more copies. If a person is on more pictures, later override earlier copies of pictures; if a person 8ff985a43603dbf8 may appear in more pictures, only one file with this name will exist. You must presume that we have a simple file .picasa.ini.
I have an .ini, that consists:
[img_8538.jpg] faces=rect64(4ac022d1820c8624),d5a2d2f6f0d7ccbc backuphash=46512
[img_8551.jpg] faces=rect64(acb64583d1eb84cb),2623af3d8cb8e040;re ct64(58bf441388df9592),d85d127e5c45cdc2 backuphash=8108 ...
Is this a good way to start this program?
- for line in open('C:\Users\Admin\Desktop\podatki-picasa\.picasa.ini'):
-
if line.startswith('faces'):
-
line.split() # what must I do here to split the bolded words?
Is there a better way to do this? Remember the .jpg file must be created with a new name, so I think I should link the current .jpg file with the bolded one.