open_in_new
content_copy
import chardet with open(files[0], 'rb') as file: print(chardet.detect(file.read()))