Hi and welcome to this new lecture, in this lecture you're going to learn how
to set up Python in a Mac computer so if you are Windows user you can skip this
lecture because you have a Windows computer and we explained how to set up
platform on Windows previously in the previous lectures and the instructions
or will also work for Linux computers because a Mac is based on Unix and so
let's begin, first thing you need to know is that you already have Python on your
Mac so Python comes shipped with Mac by default now let's go and open Python.
I'm going to click here and then type terminal and then open a terminal app so
terminal is equivalent of a command line on Windows and here no let's go ahead and
open Python, you can simply call Python and if you see these three arrows there
that means you are able to start a Python session so good news, however if you
look here you'll see this is Python 2.7 so it's a bit outdated and the current
version of python is Python 3 so it's recommended that you actually install
Python 3 on your Mac or Linux instead of using the old version Python 2.7 because
we're going to use a lot of libraries later on the course and some libraries
may not be compatible for Python 2.7. You can still work with to python 2.7 if you
take the responsibility to fix errors and compatibility issues that may arise
as you learn Python, so it's going to be maybe some extra work, however I advise
you to install Python 3, so I'm going to exit Python 2 and the Python 2 session, exit
and two brackets and you go again back to the terminal. To install Python 3 open
a browser and then you should go to python.org, then go to
downloads and then install the latest version of Python which should be shown
here so python 3.6 is the current version and that should download
Python, you can see this bar in here and so please don't uninstall Python 2.7 if you
are planning to install Python 3.6 because Python 2.7 is connected to your
operating system so if you uninstall it it you may harm your operating
system, so you may get some messy errors there so simply ignore python 2.7 and so
leave it be, don't uninstall it and simply click on this package that
you had just downloaded you should see the installation wizard so simply go
and click continue, continue, continue again and read the license if you like.
I'm going to go and click on agree and than install provide your user name in there, your
Mac user name, click on install software and so finally the installation was
smooth and it was successful, click on Close, I'm going to move it to trash.
So the installation package and now go ahead and go back to terminal, so
again if you enter Python you're going to get Python 2.7, so how do you get
Python 3? Well exit and simply click Python 3 just like that execute and
you'll see that this is Python 3.6. And yeah good luck. And so normally this
is the command you will be using on Mac which means whenever I type Python on
Windows you're going to type Python 3 on Mac or Linux as easy as that, so now you
have Python installed and here you can do operations, you know you get the idea.
However please note that what we do here we programming interactively so we're
simply writing some lines with code but these lines will not be saved anywhere if
we write them in this interactive Session, so what we want to do is we want
to write scripts of code, so Python files which we can save, we can save the code
and we can execute all the lines at one and we'll be doing that in the next
lecture so please follow me and I hope it works for you and I'll talk to you in
the next lecture.