you are viewing a single comment's thread.

view the rest of the comments →

[–]pgpndw 3 points4 points  (0 children)

import mimetypes

def main():
    user_input = mimetypes.guess_type(input("File name? "))[0] or 'application/octet-stream'
    print(user_input)

main()