Hello there and welcome to this new lecture! In this lecture I'll show you
how to set up Python in your computer. Specifically these instructions are for
Windows users so if you are a Mac or Linux user you can skip this lecture
and you can go to the next lecture where I'll show you how to set up Python on a
Mac and instructions also work for Linux users so Windows users please follow if
you haven't installed Python yet, we're going to download and install python and
also try Python out. And so you go to python.org that's the official Python
website and you go to downloads and here you'll see the latest Python version.
Currently it is 3.6.0. Just click that and save file.
Also notice that there's also a version of Python 2 so Python 2.7 to be exact
but Python 2 is not being supported anymore after 2020 so Python 2 is slowly
retiring so it's advisable to use Python 3 this one in here and once you have
downloaded the dot exe file just click it. Run. You can choose to install it in the
default directory but you can also do a customized installation if you want to
change the directory, anyway make sure you have checked this option at Python
3.6 to PATH so I'm going to go with the default installation process. Yeah that
was it. Set up was successful. You can close the window now and we can go ahead
and open Pythom so how do we do that on windows? Well we can press the
Windows key button, so we're talking about the Win key. By pressing it you
will be able to search on the start button, alternatively you can simply go
to the start button, click it and then type cmd and then click on c armed.exe
and that will open the windows command prompt. And so this is like the terminal
on Mac or Linux. On Mac and Linux it is referred to as the terminal on
Windows it is referred to as a comand prompt or command line. To open Python all
you have to do is type in Python and that will open an interactive session of
Python and an interactive session is best for testing out so here you can
write lines of code one by one like that and you promptly get the results in here.
So this is why we call it interactive, but you cannot, it's not very appropriate to
write multiple lines of code, so let's say you have a program that has 10 lines
of code and in that case you'd want to write those lines in a file, in a Python
file but we will cover that later and this is the interactive shell this is
good for testing, so before you do a program you are not sure about certain
aspects, certain commands that you want to include, certain keywords that
you want including in your program so you test things out in here very quickly.
This is very efficient and it's also good for learning. To exit the
interactive shell you press exit and brackets, open and closing brackets.
Now something you maybe, you probably noted was that the Python that I opened was version
3.5.2 but why is that because I installed Python 3.6 in here, 3.6, so why did
I get five Python 3.5.2? Well the answer is that I already had
Python 3.5.2 installed on my Windows so in other words
before I install Python 3.6 I could trigger a Python shell like that so the
question is how do I run Python 3.6 now? Well the first thing you should know is
that there is no problem having multiple Python installations in your system, the
key here is that you have to assign different commands to each of your
Python instalations so for instance Python 3.5.2
has these commands to run Python. Now for Python 3.6
we need to assign another command and I'll go and search for the
installation directory of Python 3.6 so open that and now Windows
when you search for Python, when you enter the Python command here, Windows is
looking at the path variable, the Windows path variable and it's searching for
this type of command Python but this was already occupied by another so by
Python 3.5.2, that's why it triggers Python 3.5.2,
so in that case you may want to do trick here, let's say do Python 36 and
restart that command prompt and then run again python 36 and you get Python 36.
So that's the trick and again of course you can do operations here and so on
Of course you still have Python 3.5 at least I have Python 3.5 maybe you don't
because you didn't have any Python installed just yet, so that's the idea.
On your system if you install Python for the first time, if you install
Python 3.6 you'll be able to execute Python with this commands.
Python. If you had an existing Python installation and you install a new one,
no problem, you can run Python 36 like I did I hope this was clear and I hope you are
up and running now with Python And I'll talk to you in the next lectures.