From the course: Learning Python

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Working with OS path utilities

Working with OS path utilities - Python Tutorial

From the course: Learning Python

Working with OS path utilities

- [Instructor] Sometimes you need to perform just some operations with files that go beyond reading and writing data. So for example, you might need to find out information about a file, whether it exists, what the path of the file is, whether a given file is a directory or whatever. So Python provides path related utilities to help you do this and we're going to examine that now. So here in the editor, let's go ahead and open up the ospathutils.start. and you can see I've already imported some modules we're going to need to work on this example. And some of them you might already recognize from previous examples, and we've got a new one here named OS. So this module gives us the ability to work with operating system related features. And you can also see that I've imported the path module from the OS module, and we're also going to be working with some dates and times. And we'll learn about those a little bit. Just…

Contents