Split the pathname path into a pair (root, ext) such that root + ext == path, and the extension, ext, is empty or begins with a period and contains at most one period.
If the path contains no extension, ext will be '':
>>> splitext('bar')('bar', '')
If the path contains an extension, then ext will be set to this extension, including the leading period. Note that previous periods will be ignored: