Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # encoding: utf-8
- #
- # Copyright (c) 2008 Doug Hellmann All rights reserved.
- #
- """Test an individual filename with a pattern.
- """
- #end_pymotw_header
- import fnmatch
- import os
- pattern = 'fnmatch_*.py'
- print 'Pattern :', pattern
- print
- files = os.listdir('.')
- for name in files:
- print 'Filename: %-25s %s' % \
- (name, fnmatch.fnmatch(name, pattern))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement