so I have a loop that checks folder if it contains *.zip file
for file in glob.glob( os.path.join(rootdir, '*.zip')):
print "zip", file
#Check if file does not exist
if not os.path.exists(file):
print "No files"
#return
else:
some code
Now if file exist else works, but if there is no zip file print does not happen
Any suggestions?? Thank you
glob.globwill only return file that do exist what are you trying to do by testing if the file exist ?printstatements. Can you be more specific?