The application in this chapter imports a simple class called LotteryEntry, each instance of which has two variables that are numbers (NSNumber objects) and one date (NSCalendarDate). In the main script we'll loop once to construct some LotteryEntry instances, store them in an array, and then display the result.
Here is the code for the LotteryEntry class. It uses a function from objc ("objc.ivar()") which I don't understand, but I know it is designed to make Python instance variables play nice with bindings, as we'll see in the next post. (And no, I don't understand what the 'i' is all about yet).
from Foundation import * |
Here is the main script.
from Foundation import * |
This app does not have a GUI. We run it in the usual way from Terminal, and this is what it prints:
init LotteryEntry |