英文:
How do I write Python code that enters a file and outputs its 'type-size' properties?
问题
如何编写Python代码以输入一个文件'pdf,word,png...'并输出其'type-size'属性?
如何编写Python代码以输入一个文件并输出其'type-size'属性?
英文:
How do I write Python code that enters a file'pdf,word, png...' and outputs its 'type-size' properties ?
How do I write Python code that enters a file and outputs its 'type-size' properties
答案1
得分: 0
https://pypi.org/project/filetype/
For the size you can just use os.path.getsize()
英文:
For the type check this out:
https://pypi.org/project/filetype/
For the size you can just use os.path.getsize()
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论