Save this video free

Python (Fall 2026) Module 12-8: File Challenge 2

Bill Moseley, Ph.D. - Computer Science Educator · 14:33 · Watch on YouTube

Python (Fall 2026) Module 12-8: File Challenge 2 Watch on YouTube →

Overview

Bill Moseley demonstrates permanent storage for a Python ATM program using a plain-text file, `ATM_data.txt`, instead of pickle for its fixed savings and checking variables. He builds `saveData` and `loadData` functions, handles first-run file creation with `os.path.exists`, and shows how saving after account changes preserves balances between sessions.

Key takeaways

Chapters

0:00 Choosing Plain Text for the ATM's Two Fixed Account Balances
5:45 Loading Balances and Creating ATM_data.txt on First Run
11:00 Testing Deposits, Persistent Writes, and Shared Account Variables

Keep these chapters and the full searchable transcript in your own library.

Transcript excerpt

0:00 The other file challenge is to create an  app with permanent storage. Like I said, you can use pickle, or you can just use a plain  text file, depending on how you want to do things. Both are valid ways to do things. But you  will need a text file to open the data and then save the data back to the file each time as a, a  record is updated. So when the program starts up, you want to figure out a way to load the data from  a previous session with that program in from a text file. And then anytime that data is updated,  you want to save that back to the text file. So I'm going to show you using our ATM assignment.  So here's my ATM, and it's not complete. I didn't actually fill out the withdrawal portion,  but I can check balances and make deposits. So,

0:58 this is my ATM assignment. I've got my two  variables here. Now, I don't really need, for two variables like this, I don't really  need to have pickle. I could use pickle to save this with the two variables, but I don't  need pickle to save this. The way I would use this with pickle is if I had a dictionary object  that contained my accounts as dictionary entries, savings and an amount, checking and amount, I  would use pickle for sure with that. With these two hard-coded variables, I know that my,  there's always going to be just one savings and one checking account. So, I'll probably  just use a regular text file, but they, the, the flow of things is still going to be the same.  So, I've got my welcome message. I've got my while true where I have the menu. I can make a deposit.  I can make a withdrawal. I can check the balance.

This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.

Related notes

Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Bill Moseley, Ph.D. - Computer Science Educator.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.