Comment on page
🧐
FileType
Dosyaların MIME tiplerini belirleyerek hangi dosyanın ne olduğunu python ile anlamanızı sağlar
import filetype
def main():
kind = filetype.guess('tests/fixtures/sample.jpg')
if kind is None:
print('Cannot guess file type!')
return
print('File extension: %s' % kind.extension)
print('File MIME type: %s' % kind.mime)
if __name__ == '__main__':
main()
Last modified 27d ago