Hey guys, sorry if I sound a bit off for the next few videos. What we're gonna
do in the next few videos is Python, and so we're gonna start with the basic
installation, and how to check your version, and a few basic things about
Python like the command line interface idol. So, on Ubuntu 15.10 and the
derivatives of that Ubuntu system, you're gonna have Python 3.4
pre-installed and Python 2.7.9, and so there's two active versions in
development by the Python guys and basically if you're gonna be developing a
new program I usually recommend using Python 3. If you want something, if you
you're jumping into an existing project that's using Python 2, you would
need Python 2. The changes between the two are very minimal but they are
code breaking, so you can't just run a Python 2 application using Python 3.
It won't work. So, what we're gonna be doing is actually using Python 2 and that's
because we need to use a few modules, and we're going to circle back to Apache because
we're gonna be deploying a Python application through Apache, and make it
accessible to the web. So, first thing let's check what version we have of
Python. So, it's 2.7.9 The first thing that we need to do is
install the Python, it's called PIP, I don't recall what it's an acronym for or the
abbreviation, but it's basically Python's own package manager. So, to
install that type "sudo apt-get install python-pip" this will install PIP to
your system. Now if you're gonna using Python 3, you're gonna need python3-pip
and instead of running "pip" as a command you would need "pip3". For now we're working with
Python 2, so I'm gonna install this. I believe it's already installed on my
system, it is alright. So, you guys should be able to install it this way, and once
it's installed we can actually use it to install Python modules. We will get to
that in the next video. Now something I want to cover very briefly here is the Python
interpreter. So, Python is an interpreted language while C & C++ are compiled
languages, and so they're different. You wouldn't typically compile a Python application,
so you can actually use a real time CLI interface program called Idol by just typing
Python in the terminal. And, here for instance we can set, I was starting to
type JavaScript there, so to set a variable in Python you just type the name of
the variable, so I'm going to call it "age = 2300". Now if I print age it's
gonna print that number, and you can see this is real time, so that's awesome. Now
if you exit, if you want to use a different version of the Python
interpreter you can for instance type "python3" and it will use the most recent
version of Python 3. You can also type "python3.3 and if you have that specific version
you can...you know...run that interpreter. So, that's how to use different versions in the
terminal, and that's basically it for this video.
Python's already pre-installed so you're good to go. In the next video we're gonna be covering
modules and a few other things.