Advertisement
Guest User

Untitled

a guest
May 22nd, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # encoding: utf-8
  3. #
  4. # Copyright (c) 2008 Doug Hellmann All rights reserved.
  5. #
  6. """Force a case-sensitive test of a filename with a pattern.
  7. """
  8.  
  9. #end_pymotw_header
  10.  
  11. import fnmatch
  12. import os
  13.  
  14. pattern = 'FNMATCH_*.PY'
  15. print 'Pattern :', pattern
  16. print
  17.  
  18. files = os.listdir('.')
  19.  
  20. for name in files:
  21. print 'Filename: %-25s %s' % \
  22. (name, fnmatch.fnmatchcase(name, pattern))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement