Guest User

Untitled

a guest
Nov 22nd, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3. import chardet
  4. import os
  5.  
  6. # traverse root directory, and list directories as dirs and files as files
  7. for root, dirs, files in os.walk("."):
  8. path = root.split('/')
  9. for file in files:
  10. print '%s/%s => %s (%s)' % (root, file, chardet.detect(file)['encoding'], chardet.detect(file)['confidence'])
Add Comment
Please, Sign In to add comment