Re: [Tutor] unable to locate python on mac
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 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] unable to locate python on mac
On Wed, Jan 31, 2018 at 07:44:07PM +, Alan Gauld via Tutor wrote: > AS to where it is located you can find that out at the Terminal OS > prompt by typing > > $ which python3 You can also run: sys.executable from Python itself. For example, on my system: py> sys.executable '/usr/local/bin/python3.5' It will probably be somewhere different on Mac OS. -- Steve ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] unable to locate python on mac
On 31Jan2018 19:44, Alan Gauldwrote: On 31/01/18 17:42, Megan Zirger wrote: I am completely new to python and trying to learn how to set up and get going. I'm not a Mac expert but v2.7 is usually installed on a Mac by default (although its just a basic version its fine for learning) Yes, the system Python is 2.7: [~]fleet*> /usr/bin/python Python 2.7.10 (default, Oct 23 2015, 19:19:21) [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> That's from El Capitan, a few OS releases behind. [...] able to work with sublime text. I think that's a text editor right? Or is it more of an IDE? Can you run the code inside sublime? Is that what you are trying to set up? Subblime Text is just an editor. It's got lots of nice stuff but it isn't an IDE. If that's the case you probably need to type in the path to the pyhon3 interpreter in Sublime's settings somewhere. Thats the same path you got from 'which python3' above. My Sublime text seems to be associated as the default app for opening .py files already. A little surprised here, I use vim mostly and thought I'd bound MacVim (the GUI form of vim on a Mac) for .py files. If you need more details you will need to ask more specific questions. Bear in mind that although some folks here use Macs most of us don't. I live on a Mac, I'll watch this thread. But yes, Alan's remark that Python isn't an "app" in the sense of a GUI tool is probably very pertinent. Megan, you may be expecting Python to be a GUI app. It isn't, though it can be used to write them. You also need some sort of arrangement to edit python code and run it. Such arrangements tend to come in 2 basic forms: an IDE (integrated development environment) which is usually a GUI app with both editing and running capabilities, or separate editor and run arrangements. Sublime Text, which I gather you use, is, I thought, just an editor. You also need somewhere to run Python from. Those of use not using IDEs generally run the programmes from a terminal. Personally I use iterm3 for my terminals, lots of nice features. Cheers, Cameron Simpson (formerly c...@zip.com.au) ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] unable to locate python on mac
> On Jan 31, 2018, at 13:44, Alan Gauld via Tutorwrote: > > If you need more details you will need to ask more specific questions. > Bear in mind that although some folks here use Macs most of us don't. > Another pertinent question is what python did you actually install (i.e., where did you get it from)? Different bundles install differently, so knowing exactly what you downloaded will help identify some of the other questions. — David Rock da...@graniteweb.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] unable to locate python on mac
On 31/01/18 17:42, Megan Zirger wrote: > I am completely new to python and trying to learn how to set up and get > going. I'm not a Mac expert but v2.7 is usually installed on a Mac by default (although its just a basic version its fine for learning) If you have downloaded v3.6 9the latest version) then it will say so at the banner message that comes up when you run it. AS to where it is located you can find that out at the Terminal OS prompt by typing $ which python3 However you should never need to modify it or do anything to it. > I can’t find it anywhere in the applications You probably won't see it in finder unless you navigate the file system. It is not like a normal GUI style app. > able to work with sublime text. I think that's a text editor right? Or is it more of an IDE? Can you run the code inside sublime? Is that what you are trying to set up? If that's the case you probably need to type in the path to the pyhon3 interpreter in Sublime's settings somewhere. Thats the same path you got from 'which python3' above. If you need more details you will need to ask more specific questions. Bear in mind that although some folks here use Macs most of us don't. -- 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 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
[Tutor] unable to locate python on mac
Hi there, I am completely new to python and trying to learn how to set up and get going. The one problem is that I’ve supposedly downloaded the new version. When I run it in the terminal I see that I have the version but I can’t find it anywhere in the applications or anywhere on my computer as to make modifications and be able to work with sublime text. Your help is appreciated. Thank you, Megan ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor