Python 获取文件类型后缀

import os
path='file.txt'
file=os.path.splitext(path)
filename,type=file
print(filename)
print(type)

 

 

  

posted @ 2019-09-30 16:30  轻轻的吻  阅读(9296)  评论(0编辑  收藏  举报