Award-winning PDF software
Video instructions and help with filling out and completing Where Form 8815 Filers

Instructions and Help about Where Form 8815 Filers
Hey there how's it going everybody in this video we'll be learning how to work with file objects in Python and some of the useful things that we can do with these objects so whether you use Python for desktop or web applications you're likely going to be interacting with files a good bit so it's definitely a good skill to have to know how to properly interact with these file objects okay so let's go ahead and dive in so to get a file object we can use the built-in open command so I have a file here called test.txt in the same directory as my python file now if I open this file we can see that it's just a plain text file with multiple lines so let's see how we can open and read this file from within Python now the way I'm going to open up the file right now isn't the way that it's normally recommended it's usually recommended to use a context manager which I'll show you here in just a second but to show you why a context manager is useful let me first show you this method for opening files first so what we're going to do here is we're going to say F equals open and we're just going to open that test dot txt file now if you're working with files from different directories then you're going to have to pass the path to that file into the open command but since this file is within the same directory as my Python file then I can just pass in the name of the file but if you want to learn more about how paths work then we touch on that a little bit in the tutorial I did on the...