There's another way to run your Python code.
You don't have to do it through your command line, although
I like the command line just because I've been exposed to it for so long.
But if you're brand new, the command line can be very overwhelming.
Another way is to use this thing called a Jupyter Notebook.
'jupyter.org', I believe, is the website, J-U-P-Y-T-E-R.
And if we just click on 'Install', there are a few different
ways to install Jupyter Notebook.
So if you're already familiar with some Python, you have
a little bit of background with Python, you can just simply do
'pip install jupyterlab' or 'pip install notebook'.
Now, chances are you probably don't have that kind of experience
right now, and that's okay.
If you don't, you can go to 'anaconda',
I don't actually remember what this website is.
I think it's 'anaconda.com'.
Yes, 'anaconda.com'.
So Anaconda is a Python distribution.
It also comes with a lot of different tools.
So if we click on 'Download', you can download for Windows,
Mac, and Linux.
It will install Python for you.
It will also install a bunch of other things for you as well,
including a Jupyter Notebook.
So just scroll on down, click Python 3.7, or if 3.8 or 3.9
is out, go ahead, click that, download it, and install it.
Okay. So I'm just booting up Anaconda here.
And you're going to see once this loads, it comes with a
bunch of stuff. It comes with things like VS Code, RStudio,
and Jupyter Notebook.
This is the one we want.
So I'm just going to click 'Launch' here, and that spun up my Terminal,
and it's going to run the command line command from Terminal.
And here we have Jupyter Notebook.
This is probably going to be pretty hard to see on a smaller
video. So let me zoom in here.
A Jupyter Notebook is basically an interactive way to
go through your different files, and create these things called
interactive Python Notebooks.
Now I have a folder in here called 'Python_for_Everybody',
and this is where I'm going to be keeping all of my code.
Now to create a new file, all you have to do is click this
'New', go to 'Python 3'.
I have Django installed
so it's going to say this.
It might not say that for you. 'Python3',
and we're going to see this cool little thing.
Now, this doesn't look like much to begin with.
However, if we run that 'print' statement we saw in the last
video, "Hello World", and we hit 'Shift +
Enter', we can see "Hello World".
Now, let's just walk through Jupyter Notebook a little bit,
because this is not super intuitive.
So let's first turn on our toolbar. Here we go.
So you can go into a cell here and you can change
this text, "Changed", and you can rerun it, and you can just click 'Run',
and it will rerun your code for you, which is really nice.
You can actually go back and do this over and over and over
again. Let's go ahead and turn on our line numbers here.
So in this cell, we've got line number 1, just says 'print(
"Hello World Changed!")'. Down the road
you're going to see me use something called 'Markdown', and
it will just say, "Hello
This is a title", and there's actually no code to execute, it's just 'Markdown'.
So that is a 'Markdown' cell.
Usually we're going to stick with regular code cells.
There's also a bunch of shortcuts here, which if you are
a shortcut Ninja, you probably want to learn most of these
because there's some nice shortcuts in here, like how to
delete a cell, how to move up and down a cell, things like
that. For the most part
we actually don't need to know a lot of that in this course,
because we're just going to be using these cells to really
explore Python.
So let's go ahead, change that and rerun it.
Now, I'm going to save this file, and you can save your file
as well, by going to 'File', and this is all just done in the browser.
So this is not actually in my browser's file settings,
this is in what looks like a website's browser settings.
So I go to 'File', 'Save as', and let's just call this 'first_notebook'.
Now, I'm actually not going to make this publicly accessible
because this one is just, I'm going to throw this file away, it's not
useful for anything, but this is how you actually save one.
So this is the folder that I'm in.
I'm just going to call it 'first-notebook.ipynb'. 'Save',
and just like that, it's saved.
It doesn't look like it did anything.
And then you could change the title up here if I wanted to.
But whenever you see some of my code, and I'll show you
where to download all of my code down the road, you want
to do 'File', 'Open', and then you can open,
let's say 'first-notebook.ipynb', and you can see all
of my code and execute all of my code as well.
Now, last but not least, sometimes you want to run something
from the command line, this is not your command line program,
this is simply Python,
that's all this is.
This is a little interactive way of working with Python.
But if you needed to run something from the command line,
you have two options here.
You can either open up your Terminal, I've got two open, one
that I'm writing code on, and one for Jupyter Notebook that runs
behind the scenes, or you can type exclamation mark, '!',
and then whatever your command is going to be.
So mine is going to be '!python -V',
and that's just going to show me the version of Python that I'm
currently using. And hit 'Shift + Enter', and it says Python 3.7.2
Last but not least, there is a way to actually theme this.
So if you don't like all the bright colors and the light
Grays, you can actually theme this. In your command line
you could do 'pip install jupyterthemes'.
And then, yeah, see, it's installing Jupyter Themes for me.
[no audio]
Cool. So it did a bunch of stuff, and then you could run,
I think it is 'jt -t',
and then the name of the theme, something like that.
You'll have to look into that on your own, because I'm just
going to use this standard version just so it keeps it nice and simple.
And as, I don't really want to bloat this course with too many things,
but I do want to show you that you can change the theme of
this, so it looks a little nicer.
Maybe it looks more like your regular text editor. So you
can do that as well.
I think one of them is actually 'monokai',
I have no idea how to spell that right,
but you could do something like that.
And then you just shutdown Notebook, and start it up again
from scratch, and it will look different.
Anyways, that is a Jupyter Notebook in a nutshell.
If you want to, you can go ahead and you can explore all
the different cells, things that you can do, the commands,
your command palette, or all your shortcuts.
You could search through them.
You can create new files. You can cut text. You can move
up and down cells. You can do all sorts of stuff in here.
So for the good majority of this course, we're going to be
using a Jupyter Notebook.
And when it comes to learning Python, I would highly recommend
downloading Jupyter or Anaconda, and using Jupyter Notebook
just so you can learn and tinker with Python.
You don't have to worry about retyping anything.
You can always just come back and you can undo something,
rerun this out with 'Shift + Enter'.
I wanted to get rid of it,
get rid of that one,
get rid of that one, get rid of that one.
So I just deleted cells using a shortcut.
So no big deal.
And again, if you ever wanted to change it again,
if you ever wanted to change something, it will just automatically
run for you. It's very, very nice tool to have.
You don't have to worry about retyping anything, so definitely,
definitely get Jupyter Notebook.
It's completely free.
But if you don't want to, you can always just use the standard
Python interactive shell.
[no audio]