Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # cdieview.py
- # Implementation of a DieView with changeable forground color
- # Illustrates inheritance
- from dieview import DieView
- class ColorDieView(DieView):
- def setValue(self, value):
- self.value = value # remember this value
- DieView.setValue(self, value) # call setValue from parent class
- def setColor(self, color):
- self.foreground = color
- self.setValue(self.value)
Add Comment
Please, Sign In to add comment