>
> for f in file1 file2 file3 file4 file5:
>     a = os.path.exists('/home/dir1/file.txt')
>     b = os.path.exists('/home/dir2/file.txt')
>     c = os.path.exists('/home/dir3/file.txt')
>     if a and b and c:
>          do ...
>     elif a and b :
>          do ...
>     elif a :
>           do ...
>     elif b :
>           do ...
>     elif c :
>            do ...
>     else:
>            #file doesn't exist
>            do ...
>
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to