def get_python_executable():
 executable = sys.executable.replace('pythonw.exe', 'python.exe')
 if executable.endswith('spyder.exe'):
  executable = 'python.exe'
 return executable

def get_python_executable ( ) : executable = sys . executable . replace ( 'pythonw.exe' , 'python.exe' ) if executable . endswith ( 'spyder.exe' ) : executable = 'python.exe' return executable
return path to python executable .