📜  py3 识别文件扩展名 - 任何代码示例

📅  最后修改于: 2022-03-11 14:57:42.036000             🧑  作者: Mango

代码示例1
import os
source = ['test_sound.flac','ts.mp3']

for files in source:
   fileName,fileExtension = os.path.splitext(files)
   print fileExtension   # Print File Extensions
   print fileName   # It print file name