Advanced Python Topics: File Operations in Python
Python
| Beginner
- 11 videos | 1h 11m 38s
- Includes Assessment
- Earns a Badge
Python includes functions and modules that simplify working with files. In this 11-video course, explore operations for standard text files and handling of formatted data such as JSON and CSV by using Python modules designed for such data. Learners begin with a look at some of the file operations in Python. Use Python's open function to open a file for reading, and differentiate between the read(), readline(), and readlines() functions. View differences between opening a file in write mode and append mode in Python. This leads on to distinguishing between the r+ and a+ modes to read from and write to a file; using load and loads functions of the json module to parse JSON data, and converting Python dictionaries and lists into JSON strings and files. Next, learn how to identify file formats that can be handled by the CSV module in Python, and convert Python dictionaries and lists into CSV files. The final tutorial concerns defining a customized file format, creating a CSV dialect, and using that to parse and write data.
WHAT YOU WILL LEARN
-
Discover the key concepts covered in this courseUse the open function in python to open a file for readingRecognize the differences between the read(), readline(), and readlines() functions when working with files in pythonRecall the differences between opening a file in write mode and append modeDistinguish between the r+ and a+ modes to read from and write to a fileUse the load and loads functions of the json module to parse json data
-
Convert python dictionaries and lists into json strings and filesIdentify some of the file formats that can be handled by the csv module in pythonConvert python dictionaries and lists into csv filesDefine a customized file format creating a csv dialect and use that to parse and write dataSummarize the key concepts covered in this course
IN THIS COURSE
-
2m 13sIn this video, you'll learn about the file operations in Python. We will start by looking at how we can read data from unformatted X Files, and explore the different ways in which such files can be passed. From reading data in chunks to accessing data at specific points in the file. FREE ACCESS
-
8m 40sIn this video, you will learn how to use the open function in Python to open a file for reading. FREE ACCESS
-
7m 44sUpon completion of this video, you will be able to recognize the differences between the read(), readline(), and readlines() functions when working with files in Python. FREE ACCESS
-
8m 30sAfter completing this video, you will be able to recall the differences between opening a file in write mode and in append mode. FREE ACCESS
-
7m 13sIn this video, you will learn about the r+ and a+ modes. You will also discover how to open a file in append mode. FREE ACCESS
-
7m 40sIn this video, you will learn how to work with JSON formatted data within files. You will also discover how to create a new JSON file, and then save it. FREE ACCESS
-
6m 27sIn the previous video, we saw how we can both read JSON data from strings as well as files, and then load them into a Python dictionary. In this video, we will start off by initializing another Python dictionary. FREE ACCESS
-
8m 16sIn this course, we have taken a look at how we can work with text files in Python. We have also covered the use of the JSON module in order to work with specific kinds of text files which contain data in the JSON format. It is now time for us to examine one more module available for Python in order to work with CSV data. FREE ACCESS
-
8m 46sIn the previous video, we saw how we can use the csv.reader object in order to load the contents of a CSV file, and then make each row available within our Python code in the form of a list of strings. FREE ACCESS
-
4m 37sWhen working with the CSV module, we have seen that the data which we can work with need not necessarily be comma separated values. We can have tab separated values, pipe separated values, and in fact, there is a lot of flexibility in terms of the types of files which we can work with. FREE ACCESS
-
1m 31s
EARN A DIGITAL BADGE WHEN YOU COMPLETE THIS COURSE
Skillsoft is providing you the opportunity to earn a digital badge upon successful completion on some of our courses, which can be shared on any social network or business platform.
Digital badges are yours to keep, forever.