Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import chardet
- import os
- # traverse root directory, and list directories as dirs and files as files
- for root, dirs, files in os.walk("."):
- path = root.split('/')
- for file in files:
- print '%s/%s => %s (%s)' % (root, file, chardet.detect(file)['encoding'], chardet.detect(file)['confidence'])
Add Comment
Please, Sign In to add comment