‫Welcome back.
‫This short video is for those who haven't really worked with Linux and Mac OS Terminal or Windows Command
‫prompt.
‫So if you are like me some years ago who hasn't really encountered terminal or command prompt, then
‫this video is for you.
‫If you are familiar with terminal or command prompt, then please skip the video.
‫This video is really for people who have almost never encountered Linux Terminal or Windows Command
‫prompt or Mac OS Terminal, both the terminal in Linux and the Mac OS, and then the command prompt
‫in Windows.
‫They're very similar.
‫And in this course, I recommend you to use terminal or command prompt to run Python files.
‫And so I'm going to give you a short explanation of how to use terminal or command prompt for the purposes
‫of this course.
‫Essentially, I want you to know how to launch Python programs using terminal or command prompt.
‫So if you look at the screen, then you know that I'm in my desktop.
‫And so now I'm going to go into my default home folder.
‫So you see that I'm in my default home folder and then I have a lot of files here and now from this
‫default home folder.
‫I want to enter into my desktop folder, and my desktop folder is right here, so I'm going to click
‫it.
‫And you see, I have my files here, these files that you see here.
‫These are these files here.
‫So it's the same thing.
‫And now let's say that I want to go back into my default home folder, so I'm going to go here.
‫OK?
‫This is how most people in the world use computers.
‫However, there is another way to navigate through these folders.
‫Here I have my terminal and in windows.
‫It would be command prompt.
‫And in macOS you also have a terminal.
‫And so I have opened my terminal and actually here inside my terminal, I'm inside my home folder so
‫I can write here else.
‫And that command will show me all the files that I have in my home folder.
‫And there you go.
‫You see, I have all my files here.
‫And by the way, if you are in windows, then you don't write else.
‫You write dear.
‫But in Linux, you write less.
‫So being here is the same like being here now, if I don't want to see those files anymore, then I'll
‫just write clear.
‫And now, just like we went from our default home folder into our desktop folder and then we went back
‫to our home folder.
‫What we did, we navigated through folders, but we can also do it through the terminal and we do like
‫this seed.
‫And then we write desktop.
‫And now what we have done, we have done this.
‫We have entered into our desktop folder, but through our terminal and by the way, in Windows and in
‫Mac OS, it's the same thing.
‫If you want to change your folder in Windows, you write code.
‫And the same thing applies to Mac OS.
‫And now if I want to see what I have inside my desktop, then I write less.
‫And you can see I have the same files here.
‫So right now, I'm in my desktop folder, in my screen and also in my terminal.
‫And now let's say that I want to enter my folder here.
‫So you see, I have more files here, and I can do the same thing in my terminal.
‫I write code, which is change directory.
‫And then the name of the folder empty copied Udemy course.
‫And by the way, in terminal, you can complete the names of the folders or the files with a tap button.
‫So, for example, I have only written this part and then I click the tap button and it has auto completed
‫the name of the folder and then I click Enter and I'm inside the folder.
‫I write else.
‫And as you can see, I'm now inside the folder called NPC PID Udemy course, and you can see that the
‫same files that I have here, the same folders.
‫I also have them here.
‫All of them.
‫Of course, you need to have that specific folder in your current location.
‫Only then you can enter into the folder through this see command.
‫If you don't have that folder in your current location, then you can do it.
‫You can only enter into the folders that you actually have in your current location in your computer.
‫Just like when you're in your desktop, you cannot enter into the folders from your desktop that you
‫do not have on your desktop.
‫The same logic applies to Terminal and Windows Command prompt.
‫If I want to go back, I write C d space two dots enter and then I'm back.
‫And so again, if I want to go one folder back, I can just write code.
‫Two dots and guess where I am at right now.
‫Well, I went to folders back and now I'm again in my home folder.
‫And so if you haven't really worked with Terminal or command prompt before, then do like I do when
‫you write your Python script, then just save it in your desktop.
‫Just save it here.
‫And so when you're in your desktop, then you can see that your saved file is here.
‫And so when you're in your home folder in your terminal or command prompt, then just go into your desktop
‫folder, see the desktop again.
‫See the is in Linux, Windows and Mac OS.
‫Now, when you are in your desktop, then you write either Alice in Linux or did it in Windows Command
‫prompt in Mac OS.
‫It's also Alice.
‫And then you can see the files that you have in your desktop, so you have to Python files here.
‫This one here and this one here, I remember Python files.
‫They need to be saved with this Dot Pi extension.
‫And so when your file is in your desktop and you are inside your desktop, but through your terminal
‫or Windows Command prompt, then in Linux Terminal you run your Python file like this.
‫You write Python three and then the name of the file, which in this case is this one.
‫And then you press enter, if you have an error there, then it will display you this error, for example,
‫I have an error here in Line 15.
‫In that case, you have to enter into your Python file that you had saved in your desktop, which is
‫this one here.
‫And so I have a bunch of stuff that I haven't commented out, so I'm just going to delete it and so
‫I'm going to save the file.
‫This is the file that is saved here in desktop and then I can close the file, and so I'm going to clear
‫my terminal.
‫But you can see that I'm still in my desktop.
‫And so in order to run the file, I write Python three and then calculus seems straight.
‫Line that pie and enter.
‫And there you go.
‫You see, the python file is running if you want to close the file and you just press X. And that's
‫how you run a python file with your terminal.
‫Now, if you have Windows Command prompt, then it's a bit different.
‫Well, in fact, the only difference is that in Windows Command prompt, you don't write this.
‫Once you're in your desktop, you simply write the name of the file.
‫So this would be in Windows Command prompt.
‫This one is in Linux Terminal and in Mac OS terminal.
‫So in Linux Terminal and Mac OS Terminal, you have to write Python three and then space.
‫And the name of the Python file.
‫And don't forget the Dart Pi extension in Windows Terminal.
‫You simply write the name of the Python file with this Dart Pi extension and then you press enter.
‫And that's the only difference.
‫And now if I want to print something, so let's say that I enter into this file again, and let's say
‫that I want to print this distance array.
‫Then I write here.
‫Print distance.
‫I save it.
‫I close it.
‫And then if I run my python file again, then of course, I cannot do it like this because I'm using
‫Linux in Windows Command prompt.
‫You would do it like this, but in Linux, I write it like this.
‫And by the way, Terminal remembers your previous commands.
‫So let's say that you're in your desktop, and if you press the arrow up, then you get your previous
‫command.
‫You press the arrow up again and then you get the command before that.
‫So with this command, I run my Python file.
‫I have my animation here.
‫And as you can see, I have printed my distance array.
‫So if I make it bigger and there you go.
‫This is your distance array.
‫So we right clear.
‫And by the way, there are many commands both in Linux and Mac OS Terminal and Windows Command prompt.
‫You can copy paste files using terminal or command prompt.
‫You can move files from one folder to another folder using terminal or command prompt.
‫You can delete files and install programs using terminal and command prompt.
‫And the thing is that if you get used to it and you do it many times, then you might be faster working
‫in your terminal or command prompt than in the traditional way where you would enter your folder and
‫then either press Control C Control V.
‫If you want to copy, paste it or click the right click and then copy and then paste.
‫And so it's a nice thing to learn to work with terminal or command prompt.
‫And there are many good tutorials on YouTube that I have used to learn about it.
‫And so let's say that I want to enter into my MP Udemy course folder again.
‫So I'm here.
‫Now you already know how to go back right seed.
‫And then space and two dots.
‫However, what happens if I don't put those two dots?
‫If I only put CD, then no matter in which folder you are.
‫You go back into your default home folder.
‫And so that's it on the terminal and the command prompt.
‫Thank you very much.