- Microsoft Silverlight 4 and SharePoint 2010 Integration by Packt Publishing
- Expert Python Programming by Packt Publishing
These are two resources any programmer should have on the old bookshelf, or in the e-reader.
Split the pathname path into a pair (root, ext) such that root + ext == path, and ext is empty or begins with a period and contains at most one period. Leading periods on the basename are ignored; splitext('.cshrc') returns ('.cshrc', '').
def __fileExtension(filePath):
import os
return os.path.splitext(filePath)[1]