Answers for "py3 identify file extension"

0

py3 identify file extension

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
Posted by: Guest on June-03-2021

Browse Popular Code Answers by Language