Monday, October 25, 2021

What is a Pomodoro?

 Pomodoros 6: Handicap 2 

Pomodoro 1: I should have explained at once what a “pomodoro” is. It’s the common Italian noun for “tomato.” The tomato is a new world fruit, and we derive its name from the Nahautl word tomatl, but when it arrived in Italy, the Italians named it pomo d’oro, “golden apple”: apparently tomatoes back then were yellow. 


But how does it come to mean “a measured chunk of time devoted to a task”? That comes from the Italian student Francesco Cirillo, who in his first year of university found himself unable to focus on his homework. He grew more and more frustrated with his procrastination and distractions, until one day he seized his kitchen timer -- one of those kitschy ones, shaped like a tomato -- and set it for five minutes, muttering, “can I even study for five minutes?” It turned out that he could study for five minutes, with a timer running: and it turned into his main method of focusing and organizing his time. And so the chunks of time became pomodoros, and he called his strategy the Pomodoro Method. I have his book on hold at the library, and when I actually read it, I may have more to say. At present that’s all I know.


Pomodoro 2,3: Python. 7:15 - 8:05. Class names are written in CamelCase; instances and modules should be lowercase_with_underscores. Every class and module should have a docstring. NB you can use forward slashes in file names and they will work even on Windows! Yay!


with open(filename) as file_object:

    For line in file_object:

        print(line)


Python will close the file when the “with” block finishes. Nice.


with open(file_name, ‘w’) as file_object

    File_object.write(“some text to the file”)


Fine and dandy, but if there was something IN file_name when you started, Python erases it before handing you the file_object. Yikes. There are other modes: ‘a’ is append, ‘r+’ is read-write. If you don’t specify you get ‘r’, read-only.


JSON stands for JavaScript Object Notation, but it’s been generalized to a common format.


Pomodoro 4,5: Palmer: finished Will to Battle


Pomodoro 6: Nickleby, 16 pp.


No comments: