In this lesson, we're going to talk about how to handle files in Python. Once that's finished, we have to ask ourselves, what does it mean to handle files in Python? Well, Python file handling has a great many strengths. And one of the strengths that I find most useful, is the ability to open up a text file, add stuff to it, take away stuff from it. Just take a look at it, or get rid of it. And that's what we're going to learn. But to do that, the first thing we have to do is we have to find out where our Python is located. So what I'm going to do is, I'm going to go hit the windows button in the lower left corner, and scroll to the Python executable. What I'm going to do is go to the 64 bit executable. I'm going to right click on it, and I'm going to click on more. And then I'm going to click on open file location. This brings up the Explorer, and this tells you where your Python executable is. Inside this directory, I've created a text file called Jeremy. And I will also copy this file. And I'm gonna place it in the intermediate Python directory. So when you download the source code we've created, you have that file. So if you choose not to make another one or you just want to use mine, that's fine. So we'll paste that there. Now we're ready to go. So for right now, we're just going to assume, and I will tell you right away, this is a very poor place to put files. But it's where we're putting them first so we kind of get a grasp on the very first part. in where the executable is, I have a text document called Jeremy. Now what we're going to do is we're going to do a file save as on our code. So we have a text file and we have our code page. Now we just need to know how to open that file and actually look at it. Let's go through here and I'm just going to delete everything. So we start fresh. We have a built in function we can use called open. And open allows us to open a text file. But we need to assign it a variable. So I'm going to call it my file. And I'm going to set that equal to open. And then inside, I'm just going to put the name of the file inside of quotes. In my case, it's jeremy.txt for text. And that'll open up the file. Now, we need to let Python know that we want to be able to read that file. So all we have to do is put a comma, and then inside of quotes again, we're just going to put a lowercase r and that stands for read. And then all we have to do is run a print statement. And what we're going to print is my file. And we're going to use the prebuilt function, read. So we're going to put the .operator, and then we're going to put the word, read, followed by a couple of parentheses, followed by the closing parentheses for the print statement. So if this is all done correctly and located in the correct folder, we can open up the file and read it. So let's save it. And we're going to run the module. And here it is. So now, we're able to open up a file and read it. Now, the question is, is what if my file isn't where the executable is? Well, that's very easy to do. All we're going to do is go to where the file is named, and we just put the path to the file. And I would like to recommend that you keep files in a directory that's easy to find and doesn't require a lot of typing. So for example, if you're working on your own machine, and you're working on Python, create a directory in the C drive called, Files. All you have to do is type in C:\ and then the directory name, which is files. And if I have a directory named files and in there there is a file called jeremy.text, it will open it just like it did here. Now, I may want to say, as you're playing with files and stuff like that, don't get wrapped up on finding a location. In fact, the suggestion I would make is to actually just put a flash drive in your machine and keep your files there. In our next lesson, we're going to learn how to create a File. See you then.