when may sys.executable be empty

Terry Reedy tjreedy at udel.edu
Wed Mar 11 14:31:43 EDT 2015


On 3/11/2015 10:41 AM, Wolfgang Maier wrote:
>  From the documentation of sys.executable:
>
>      A string giving the absolute path of the executable binary for the
> Python interpreter, on systems where this makes sense. If Python is
> unable to retrieve the real path to its executable, sys.executable will
> be an empty string or None.
>
> So on which systems does it not make sense ?

Importing tkinter in a Python program starts up an embedded tcl 
interpreter to run tk, but as far as I know, there is no tcl.exe on my 
system, only the tcl/tk .dlls.  I can imagine a similar situation with 
embedded python.  If a python interpreter is being run as an embedded 
interpreter *and* there is the same version of python.exe installed, I 
don't know what happens.

-- 
Terry Jan Reedy




More information about the Python-list mailing list