Python 获取文件类型后缀

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

  

猜你喜欢

转载自www.cnblogs.com/yuanqiangfei/p/11613276.html