- [Teacher] As we get started with our discussion of Python,
the first thing we want to do is get it installed.
And I'd like you to do these exercises along with me
so you're not just passively watching.
And you may already have Python installed,
it comes pre-installed,
for example, on MacOS and Linux.
However, even though I'm running a MacOS,
specifically, I'm running MacOS Catalina,
I still downloaded the version of Python
that's current at the time of this recording.
And one of the reasons is,
the version that comes with MacOS
in my case is version 2.7 a Python and Cisco DevNet,
they often use some flavor
of version three in their examples,
so I thought it might be a good idea
to run version three as well.
And there is a fairly significant difference
between versions two and three.
Most of the basic things though,
that we're going to be doing in these videos,
you can do an either version,
but I chose to install
what's current at the time of this recording,
which is 3.8.1.
Here's how we do it,
we go to Python.org and
if I hover over the downloads menu,
there's an option for downloading Python 3.8.1 for MacOS,
you might have Microsoft Windows,
there's even an option for other platforms.
For example, we could go in here
and see that you could even run a Python scripts
or edit Python scripts on your Apple iOS device
like an iPhone or an iPad.
Now, before we go out
and take a look at the Python interface,
which is called the interactive interpreter,
you might want to pause the video,
get Python installed on your system.
And then when you're ready,
resume the video.
All right, do you have Python installed?
Well, let's take a look at it.
I'm in the Terminal Window for MacOS.
And you can use whatever command line interface
your Operating System has.
And one thing that I could do
to start the Python interactive interpreter
is to simply type Python,
and that starts Python.
But if you notice,
it says that this is version 2.7.16 i just installed 3.8.1
and this makes the point that yes,
we can have multiple versions
of Python installed simultaneously.
This is just the version that came with my MacOS.
So how do we say that we want to go
to the interactive interpreter
for a specific version of Python,
let me show you, first I need to exit out of this interface.
And by the way, if we're customed to entering a command,
like end, or exit,
as we're exiting out of Cisco iOS configuration,
it doesn't work the same here,
there's a couple of options for getting out of this prompt.
I could say exit and do an open parentheses,
close parentheses, no spaces and press enter.
That will get me back to my command prompt.
Or I could have done a Ctrl+ D,
either one would work.
But if I want to run Python version 3.8.1,
I could say Python, 3.8
by the way, 3.8.1 that does not work.
I don't need to say what subversion of Python I'm running,
but I can do a number a dot and another number,
I just cannot go three digits deep.
So I could say Python 3.8
and that's going to run
the version that I have installed,
3.8.1 will do a Ctrl+ D,
or I could have typed Python three,
I've only got one version of Python three installed.
So it's going to run Python 3.8.1.
And now we're sitting at this prompt
with three greater than signs.
We call this the interactive interpreter
because when we type in a command
it interacts with us it interprets that command,
we type in immediately, and we get a response on screen.
Now in our next video,
we want to take a closer look at
this interactive interpreter.