mirror of
https://github.com/rembo10/headphones.git
synced 2026-07-19 23:44:01 +01:00
Adding Requests library
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
from __future__ import print_function
|
||||
import sys, glob
|
||||
sys.path.insert(0, '..')
|
||||
from chardet.universaldetector import UniversalDetector
|
||||
|
||||
count = 0
|
||||
u = UniversalDetector()
|
||||
for f in glob.glob(sys.argv[1]):
|
||||
print(f.ljust(60), end=' ')
|
||||
u.reset()
|
||||
for line in open(f, 'rb'):
|
||||
u.feed(line)
|
||||
if u.done: break
|
||||
u.close()
|
||||
result = u.result
|
||||
if result['encoding']:
|
||||
print(result['encoding'], 'with confidence', result['confidence'])
|
||||
else:
|
||||
print('******** no result')
|
||||
count += 1
|
||||
print(count, 'tests')
|
||||
Reference in New Issue
Block a user