5 Working with files: Being a shop manager
In this chapter
- Erik learns what a coffee shop manager needs
- Erik reads his menus from files
- Erik writes his second Python function
“Last time, you said something about a coffee shop manager,” Erik started with his brother the next day. “Something about changing menus? I forgot.”
“Yes, I said it might be good if your coffee shop manager could change the menus without going into Python code,” Simon said.
“Yes, good idea,” Erik said. “Not everyone knows Python.”
“My idea is to create simple text files for each menu—call them drinks.txt
, flavors.txt
, and toppings.txt
. Then your program can read from those files and create lists from the items in the files.”
“Why did you name them all with .txt
at the ...
Get A Pythonic Adventure now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.