So... in this example, we will see how we can search in a txt file the information we want based on a keyword. There is a list of workers that do their job once a week. We want to know who worked on each day of the week as the list is not ordered in this way. Here is the list in the txt file (called workday.txt). Save this list as a txt file with the name indicated. Then save the code in a file called searchingdays.py (or anything you like). The list Amoresano Pasqualina friday Califano Caputo monday Cavallo Matteo thursday Cesareo Filomena wednesday Cortazzo Annarita monday De Vita Maurizio monday Franco Ida friday Imbriaco Angela monday Iuliano Tiziana monday Lenza Agresta wednesday Mangia Fortunata friday Marotta La Marca monday Piciocchi Sara saturday Rambaldi Annarita friday Russo Ortensia monday Sansone Marotta tuesday Saturno Giovanni thursday Starace Guglielmo saturday The code def goSearch(day): with open("workday.txt",encoding=...
How to program with the python language together with tkinter, pygame etc.