Okey-dokey, at this point in time, you should have Python installed already,
and it's now time for a quick lesson on some command line
basics. So if you are on a Mac, there's a program called
'Terminal', and pretty much every Mac comes with this, and
you can find it by hitting command space, and then just typing
'terminal.app', or just 'terminal', and then go to 'Terminal'
app. And that will open up your command line program for
you. If you're on Windows, you'll probably have a program
called 'cmd', or 'PowerShell', or you can download one called
'Commander', 'Cmder',
and that will be a command line program that you'll use for
the rest of the course as well.
If you're on Linux, there's a program called Bash, but there's
also a ton of other programs out there that you can install.
Likewise for Windows and Mac OS as well.
So really, if you don't want to use what's already on your
computer, and every computer will come with a command line
program, you can download and install a different program.
Okay, so I've just zoomed in on my terminal here so you can see what's going on.
And for a quick little command line crash course, there's
a few things you're going to need to know.
You need to know how to list files in a directory.
So on Unix based systems,
so Linux and Mac, you can usually type 'ls -la', and it will
show you all sorts of things in here.
You can see I've already got a Fuller called 'Python_for_Everybody'.
Where's the one that I want to go into?
Let's go into 'Movies'.
So, let's say I can see that there's a folder in there called
'Movies' that I want to get into it.
I can type 'cd', and then the name of the folder, and now I'm inside of it.
And most programs will also tell you which directory you're in as well.
A directory is a folder, by the way, if you did not know that.
Now just going back a quick sec,
I did the example of 'ls -la'.
If you are on Windows, your command is going to be different.
It's going to be 'd-i-r', 'dir', and 'dir' will show you all of your
files and folders the same way that 'ls -la' does for me.
So let's 'cd' into a directory called 'Movies', that's just change
directory. You can use this on all operating systems.
'cd' just means change
directories. 'pwd' will show you exactly what directory you're
in. So I'm in the 'Users' directory,
'kalobtaulien/Movies'.
If you're on Windows, this is going to look a little different.
It's going to say something like 'C:\' drive,
I can't remember exactly what it is,
'Users', that would be
'kalobtaulien/Movies' something along those lines.
Anyway, that's what you'll see on Windows. And on Linux
it might actually just look like '/home/kalobtaulien/Movies,
I don't know, something like that.
So that's how you see where you currently are, it's 'pwd'.
Now let's say you wanted to make a directory, and this is
going to be important eventually down the road.
So if I do 'ls -la' or 'dir' on Windows, I can see that I have
a few files in here.
None of them are really important.
If I wanted to make a new directory, I could do 'mkdir',
that stands for 'Make Directory', and let's call it 'TestDir'.
'ls -la' or 'dir' on Windows,
and you can see that there is a new directory in here,
and I can change directories into there, and do 'pwd'.
[no audio]
Now if you are in a directory, and you want to move out of
it, you can always do 'cd ../', and that will move
you up a directory.
You can do it again.
'cd ../', moves you up a directory. And if you ever wanted to move
into multiple directories, you could do 'cd Movies', and then
whatever the other directory is, or a subfolder, or a subdirectory.
And for a lot of cases you can just usually type most of
the word hit tab and it will autocomplete for you.
So 'cd Movies/TestDir'
I moved into two folders at the same time there. 'cd ..
/../' will bring me out of 'TestDir',
out of 'Movies', and back into my main location, which for me is 'Users
/kalobtaulien'. One last one you're going to need to know is
'python'. 'python' is a command.
Let me clear this out as well.
Python is a command you're going to need to run.
And it's probably a good idea to try to figure out what version
of Python you have right now by typing 'python -V', and
you can see I'm using Python 3.7.2.
You might be using Python 3.7, 3.8, 3.9, something newer.
If you see,
Yeah, if you see Python 2.7., something, or other, without
having to type 'python2',
if it just shows this in here when you run this command,
that could be a problem.
So for me I just need to type 'python', and it assumes Python
3. If your computer is not assuming Python 3, you
might have to type 'python3 -V',
and you can actually see because I'm using multiple versions of Python,
if I use 'python3' instead of just the word 'python', it
uses Python 3.8.
And again, that's just because I have multiple versions of
Python on my computer.
There's also another way if you have Python 3.7, you could
do 'python3.7 -V', and it'll show you,
and I don't even know if I have Python 3.6 on here anymore.
Turns out I don't, but I could install with 'pyenv'.
That's something we can talk about down the road is multiple
versions. But the thing to take away here is if 'python -V' says
Python 2., something or other you might want to try
'python3 -V', and moving forward you're going to want
to use 'python3 yourfile.py'. We'll talk about that
again in the future lesson, but that's just something to
be aware of on the command line as well.