Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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
Comment

PREVIOUS NEXT
Code Example
Python :: Start of my python career 
Python :: python loc id in list 
Python :: 0 
Python :: How to make exit button? 
Python :: discord rich presence python 
Python :: python 2nd order ode 
Python :: how to add illegal characters to paths python 
Python :: django date grater 
Python :: pygame mixer channel loop 
Python :: foreign key on delete arguments 
Python :: how to bubble search in python stack overflow 
Python :: Rebinding a list stored in a Flask Session 
Python :: dataflair python 
Python :: KMeans 
Python :: Shelve Data Storage 
Python :: python assign variable to another variable 
Python :: remove stopwords python 
Python :: gizeh python 
Python :: first rows of data frame (specify n by param) 
Python :: how make aloop in python 
Python :: python second max in numpy array 
Python :: how to insert an array as a parameter in python 
Python :: timedistributed pytorch 
Python :: to_csv zip pandas 
Python :: Iterate over several iterables in parallel 
Python :: Python check if caps lock is pressed 
Python :: nim game in python 
Python :: How to sort a list by even or odd numbers using a filter? 
Python :: logged_passengers 
Python :: python variable and data structure 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =