LOL :)

I think you want `print(os.path.splitext(cmd)[0])`. That's safe on POSIX as well.