Vote count:
0
I have this snippet which basically checks if a file exists with pattern matching. Please help me with a better way to do this.
import glob
for afile in glob.glob( "*.non-existant-file" ):
print afile
try:
if afile:
print "OK"
except:
print "Come back later"
asked 18 secs ago
glob on non existant file with patter matching
Aucun commentaire:
Enregistrer un commentaire