Python Programming 20. Write To a Text File

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

Пікірлер: 7

  • @engineeringmadeasy
    @engineeringmadeasy Жыл бұрын

    Are you adding all of your videos in playlist. Right?

  • @stephenhemingway9435
    @stephenhemingway9435 Жыл бұрын

    Is there a way to sort the videos in this channel by date? KZread appears to have removed this feature, but the old videos are always worth watching again.

  • @ComputerScienceLessons

    @ComputerScienceLessons

    Жыл бұрын

    I don't know to be honest. My playlists are in sequence but some of the much older videos (such as those on VBA) are getting a bit dusty. :)KD

  • @stephenhemingway9435

    @stephenhemingway9435

    Жыл бұрын

    @@ComputerScienceLessons Funny that you mention VBA, Kevin. I've been watching them again and comparing VBA with Python out of historical curiosity.

  • @engineeringmadeasy
    @engineeringmadeasy Жыл бұрын

    Hi Can I use your videos for OCR A level computer Science.

  • @olivier1076
    @olivier1076 Жыл бұрын

    Comic sans

  • @ComputerScienceLessons

    @ComputerScienceLessons

    Жыл бұрын

    I was going for 'silly' :)KD