Python for Absolute Beginners Transcripts
Chapter: Writing your first lines of code
Lecture: Running the Python REPL on macOS
0:00 Well, let's get our REPL running here on MacOS. Again, if you're on Windows hold tight for just a moment and we'll get over there as well.
0:08 Now, I have to have pinned a terminal in my dock. If you don't happen to have it pinned you can come over to your applications go to utilities.
0:19 Down here somewhere there's terminal. And you can run that from there. We're going to run it like so. Now what's the most natural thing to do
0:26 to get your Python REPL running? Well, it's probably to type Python. That sort of works. This looks like what we saw before
0:33 except for notice this is not good. It's Python 2. Now Python 2 is no longer supported. There's Python 3 is the current version.
0:42 So definitely not something we want to run. It just turns out that MacOS happens to have an old version
0:48 of Python that has been shipping with it forever. And because that's already there it's name is Python so we have to refer to it on MacOS
0:55 and in Linux in a different way, we say Python3. Remember, long as this is 3.6 and above. So 3.6.whatever. Ignore that six.
1:05 That's just not what we're talking about. 3.6 or higher you're going to be golden. The latest version is 3.8. But on this account I don't happen
1:12 to have that set up that way. Here we are in our Python REPL. We should be able to do things like we saw on the screen
1:18 Print, "Hello World!", make sure you put that in quotes. And close in privacies. Ta-da! It's working! "Hello World!" is often this little example shown
1:27 say what is the least amount of code that I can write to get "Hello World!" on the screen in many programming languages?
1:34 Python it's incredibly simple, as you see. Other languages it's actually a bunch of steps. The real meaning and value behind "Hello World!"
1:41 is to show you what is the smallest step you can do to get that on the screen. It's to make sure that you can run the code
1:48 in other languages, compile it and make sure that your system is set up to work. So if you can get Python to run and you can type this.
1:55 And you get this to come out, everything's good. You have the right version of Python and you're ready to go.
2:00 We'll start writing code in here in just a second. But, remember, make sure that's 3.6 or higher.