[Tutor] unable to locate python on mac

Alan Gauld alan.gauld at yahoo.co.uk
Thu Feb 1 05:14:34 EST 2018


On 01/02/18 02:15, Steven D'Aprano wrote:

> You can also run:
> 
> sys.executable

I'd forgotten that one...

> 
> from Python itself. For example, on my system:
> 
> py> sys.executable
> '/usr/local/bin/python3.5'

For the benefit of the OP, you need to import sys first
so it looks like:

>>> import sys
>>> sys.executable


-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list