| 45 | print 'Observer1: Subject %s has updated attr %s to %s' % (subject.name, attrname, value) |
| 46 | |
| 47 | class Observer2: |
| 48 | def update(self, subject, attrname, value): |
| 49 | print 'Observer2: Subject %s has updated attr %s to %s' % (subject.name, attrname, value) |
| 50 | |
| 51 | # Example |
| 52 | def main(): |