import os path, ext = os.path.splitext("C:\\Python34\\python.exe") print(path,":",ext)
C:\Python34\python : .exe