filmov
tv
Python Programming 20. Write To a Text File
![preview_player](https://i.ytimg.com/vi/GAuwhF_73H4/maxresdefault.jpg)
Показать описание
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
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
Комментарии