Using os.path.splitext to obtain executable

As requested