This is the 20th in a course of computer science video lessons introducing programming with Python. In this video lesson, you will learn how to create a Python program that can write data into a text file. This is important if your application needs to save data while the application is not in use; for example, you might be making a game that needs to save high scores in some kind of leader board. This lesson begins by reviewing the techniques for reading a text file that were covered in the previous lesson, including how to search a text file for a particular data item. You will then learn how to use the append parameter of the open command, which will open an existing text file so that new data can be added to it, or it will create a new text file if it does not already exist. You also will learn now to put line breaks in a text file while writing to it. In addition, you learn about the issues associated with opening a text file for both reading and writing from within the same Python program.
Chapters:
00:00 Review - Search a text file line by line
02:51 Write text to a text file
04:07 Line breaks in a text file
04:50 Reading and writing to the same text file
On this page of the site you can watch the video online Python Programming 20. Write To a Text File with a duration of hours minute second in good quality, which was uploaded by the user Computer Science Lessons 21 November 2022, share the link with friends and acquaintances, this video has already been watched 2,092 times on youtube and it was liked by 40 viewers. Enjoy your viewing!